Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- App.controller('AdminUserGroups', function($scope, $http, $document, $modal, $log) {
- $scope.groups = [{
- "id": 1,
- "name": "Super Administrator",
- "permissions": "{\"superuser\":1}",
- "created_at": "2013-09-15 12:19:46",
- "updated_at": "2013-09-15 12:19:46"
- }, {
- "id": 2,
- "name": "Editor",
- "permissions": "{\"editor\":1}",
- "created_at": "0000-00-00 00:00:00",
- "updated_at": "0000-00-00 00:00:00"
- }, {
- "id": 3,
- "name": "Administrator",
- "permissions": "{\"admin\":1}",
- "created_at": "0000-00-00 00:00:00",
- "updated_at": "0000-00-00 00:00:00"
- }, {
- "id": 32,
- "name": "sdfsdfsd",
- "permissions": null,
- "created_at": "2014-01-25 20:35:45",
- "updated_at": "2014-01-25 20:35:45"
- }, {
- "id": 33,
- "name": "dffdfdg",
- "permissions": null,
- "created_at": "2014-01-25 20:46:54",
- "updated_at": "2014-01-25 20:46:54"
- }];
- console.log($scope.groups);
- $scope.getTotalGroups = function() {
- return $scope.groups.length;
- };
- $scope.deleteGroup = function(idx, groupId) {
- $scope.groups.splice(idx, 1);
- };
- $scope.showAddGroupModal = function() {
- $modal.open({
- templateUrl: 'add-group-modal.html',
- controller: function($scope, $modalInstance) {
- $scope.formData = {};
- $scope.addgroup = function() {
- $log.log($scope.formData);
- console.log($scope.groups);
- $modalInstance.close($scope.formData);
- }
- $scope.cancel = function() {
- $modalInstance.dismiss('cancel');
- };
- }
- /*,
- resolve: {
- group: function () {
- return $scope.formData;
- }
- }*/
- });
- }
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement