var HomeCtrl = function(NotesSvc, $scope, $timeout, $ionicSlideBoxDelegate) {
    this.titre = "Vidéo Ionic ENI";
    this.notes = [];
    this.loading = true;

    this.getNotes = function() {
        self.notes = NotesSvc.getNotes();
        $ionicSlideBoxDelegate.update();
    };

    this.deleteNote = function(id) {
        NotesSvc.deleteNote(id);
        this.notes = NotesSvc.getNotes();
    };

    var self = this;
    $scope.$on("$ionicView.afterEnter", function(event, data){
        self.getNotes();
    });
};