I am using a ng-repeat on a element to iterate based on array from scope. And i am also having a custom directive(to create jquery widget) on the same element.
Now the problem is the custom directive get compiled before the template from the ng-repeat get evaluated and hence i am getting the raw template string in widget.
HTML
<div ng-repeat="o in arr" id="{{o}}" ui-ngrid></div>
Link
The link function is as follows.
module.directive("uiNgrid", ['$compile', function ($compile) {
return {
restrict: 'CEA',
priority: 999,
link: function (scope, element, attrs) {
element.nGrid(processAtrr(attrs));
}
}
});
Controller
$scope.arr = ["0","1"];
Now inside my code, i am getting the id values {{o}} instead of the evaluated value.
What the reason behind this and how can i resolve this issue?