(function () { "use strict"; var name = 'adAdminUserList'; angular.module('app.directive') .directive('adAdminUserList', ['$state', 'cfg', 'adminUser', 'staticData', 'user', function ($state, cfg, adminUser, staticData, user) { return { templateUrl: 'directive/' + name + '/' + name + '.html', scope: {}, controller: 'BaseListController', link: function (scope, element, attributes, controller) { cfg.debug && console.log(name); controller.bridge = adminUser; scope.userRoleId = user.roleId; scope.staticData = staticData; scope.roleNames = adminUser.roleNames; scope.create = function () { $state.go('menu.' + user.roleId + '.user.create'); }; scope.view = function (index) { var id = scope.data.list[index].id; $state.go('menu.' + user.roleId + '.user.view', {id: id}); }; scope.edit = function (index) { var id = scope.data.list[index].id; $state.go('menu.' + user.roleId + '.user.edit', {id: id}); }; scope.remove = function (index) { var id = scope.data.list[index].id; controller.listAction('remove', id); }; controller.list(); } }; }]); })();