(function () { "use strict"; var name = 'adAdminUserView'; angular.module('app.directive') .directive('adAdminUserView', ['$state', 'cfg', 'adminUser', 'staticData', 'user', function ($state, cfg, adminUser, staticData, user) { return { templateUrl: 'directive/' + name + '/' + name + '.html', scope: {}, controller: 'AbstractDirectiveController', link: function (scope, element, attributes, controller) { cfg.debug && console.log(name); controller.bridge = adminUser; scope.static = staticData; scope.data = null; if (attributes[name]) { controller.action('read', attributes[name]).then(function (response) { scope.data = response.data; }); } else { $state.go('menu.' + user.roleId + '.user'); } } }; }]); })();