HI have directive with template . in the template I use with long ng-if like:
ng-if="exp1 && (exp== '' || exp == null) && ..."
how can I add the ng-if into a function that return true or false?
it should be updated if the scope has changed. when i tryin with function it cals lot of times
template:
<div ... ng-if="fun()"></div>
my directive:
return {
restrict: "AE",
templateUrl: "tmp.html",
replace: true,
scope: {
param: '=',
},
link: function(scope, element, attrs, ctrl) {
scope.fun = function() {
console.log("log") - show lot of times - does not stop
}
}
}