Advertisement
Guest User

Untitled

a guest
Oct 28th, 2016
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.46 KB | None | 0 0
  1. 'use strict';
  2.  
  3. (function() {
  4.  
  5. class AdminController {
  6. constructor(User, Modal) {
  7. // Use the User $resource to fetch all users
  8. this.users = User.query();
  9.  
  10. // Our callback function is called if/when the delete modal is confirmed
  11. this.delete = Modal.confirm.delete(user => {
  12. user.$remove();
  13. this.users.splice(this.users.indexOf(user), 1);
  14. });
  15. }
  16. }
  17.  
  18. angular.module('myApp.admin')
  19. .controller('AdminController', AdminController);
  20.  
  21. })();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement