authors.controller.js 395 B

1234567891011
  1. (function(){
  2. app.controller('Authors', ['$scope', 'books.repository', '$routeParams', function ($scope, booksRepository, $routeParams){
  3. booksRepository.getAuthors()
  4. .then(function(respons){
  5. $scope.authors = respons.data
  6. })
  7. $scope.deleteAuthor = function(id){
  8. $scope.authors.splice($scope.authors.indexOf(id), 1)
  9. }
  10. }])
  11. })();