I couldn't find an answer so I'm bringing it up here.
Does it make a difference in resources or performance if I use
$scope.isAllowed = true;
<div ng-if="isAllowed"></div>
instead of
$scope.isAllowed = function() {
return true;
};
<div ng-if="isAllowed()"></div>
I know Angular2+ has a advantange if i use the first option, but does this also apply to AngularJs?
For one time binding I could find {{::isAllowed}}
at the expression guide but I don't think that works in this case.
I also found out that the binding of ng-if makes it a watcher, what comes down to the $scope.$watch
function. But that does not awnser the question.
Anyone has some more in-depth on this topic?