(function(){ app.controller('Authors', ['$scope', 'books.repository', '$routeParams','utils', function ($scope, booksRepository, $routeParams, utils){ booksRepository.getAuthors() .then(function(respons){ $scope.authors = respons.data },function(error){ utils.notify({ message: error.statusText, type: 'danger' }) }) $scope.deleteAuthor = function(id){ $scope.authors.splice($scope.authors.indexOf(id), 1) }; // utils.notify({ // message: 'her na lob', // type: 'danger' // }) $scope.user = { name: 'awesome user' }; $scope.updateUser = function(){ console.log($scope.user) }; }]) })();