3 angular.module('dashboardApp')
4 .controller('AdminCtrl', function($scope, $http, Auth, User) {
6 // Use the User $resource to fetch all users
7 $scope.users = User.query();
9 $scope.delete = function(user) {
10 User.remove({ id: user._id });
11 $scope.users.splice(this.$index, 1);
16 $scope.create = function(user) {
18 $scope.users.push(user);