Hi guys I've created 2 directives, one for each object that I have, one is adminGroups, the other is adminProfiles. I have this problem, the 2nd directive is not called at all. This is the controller:
angular.module('Modulx').controller('AdminsController', ['$scope', 'AdminService'
function ($scope, AdminService ) {
$scope.hasLoad = false;
$scope.groups= null;
$scope.profiles = null;
AdminService.getAdmins().then(function (response) {
$scope.hasLoad = true;
$scope.groups= response.data.Groups;
$scope.profiles = response.data.Profiles;
});
}
]);
And i have this html section, where when data has been finished to load, i assume that both directives should be called
<section class="section admin-section" ng-if="hasLoad">
<administrator-group data="groups" />
<administrator-profile data="profiles " />
</section>
This is the directive structure they are the same, and the 2nd (which is not called) is just as this except that word "Group" has been replaced by "profile". This one works just fine.
angular.module('Modulex').directive('administratorGroup', [
function () {
return {
restrict: 'E',
scope: { data: '=groups' },
templateUrl: '/Content/AngularApp/Admin/AdminGroups/Template.html',
link: function (scope, element, attrs) { },
controller: function ($scope) {
$scope.data;
}
};
}
]);
What is the problem? why is the 2nd directive ignored or not being called? Thank you.
The other directive
angular.module('Modulex').directive('administratorProfile', [
function () {
return {
restrict: 'E',
scope: { data: '=profiles' },
templateUrl: '/Content/AngularApp/Admin/AdminProfiles/Template.html',
link: function (scope, element, attrs) { },
controller: function ($scope) {
$scope.data;
}
};
}
]);
If i exclude the group directive the profile directive will work just fine.