are there any negative (performance) implications of binding directly to a function in e. g. ng-show directive?
<div ng-show="myVm.isVisible()">
....
</div>
// controller snippet (exposed through controllerAs syntax)
function myCtrl (myService, authService) {
this.isVisible = function isVisible () {
return (myService.state === 'foo' && authService.isAuthorised);
}
}
this pattern allows hiding sometimes complex logic in the template and putting in the testable controller (or service) but some developers seem to be worried about binding a function in directives like ng-show, ng-if etc.