I recently started studying about digest and performance improvements in AngulaJs and found on my website that I'm using tons of
there is a variable that may change, but often is fixed at the startup of the controller and then never changes.
What should I do so to improve performance avoiding digest to evaluate every loop those unchangeable
? Should I change directive? With what?
In my header template I have a div that can be seen only by particular type of user. It's just a div, so I don't want to call some different template.
<div ng-if="userIsSuperior()"> ... </div>
When first evaluated, the return vale of
never changes (during this session of course), but I know that AngularJs Digest evaluates it every loop.
How can I avoid this? Or am I missing something?