I write below directive to make call a function when ngRepeat
element gets rendered on UI.
Directive
directives.directive('repeatDone', function() {
return {
restrict: 'A',
require: 'ngRepeat',
link: function(scope, element, attrs, ngModel) {
if (scope.$last) {
scope.$eval(attrs.repeatDone);
}
}
};
});
But it is giving $compile
error.
If I remove require part, it works OK.
Why AngularJS can not accept "require: 'ngRepeat'"? Help would appreciated.