I am wondering about the performance impact of the code variations below as complexity scales. Part of the answer to this (those using properties) has already been addressed in AngularJS : Why ng-bind is better than {{}} in angular? but I would like to understand the impact of using functions instead of properties.
It would seem to me that with properties Angular "knows" in a sense when there is a change, while a function is opaque so Angular would not know, and would have to evaluate every time. Yet, according to the other SO question mentioned above, Angular is already evaluating every time with direct templating anyway. So is there really any performance penalty for using a function instead of a property? And what are the pros and cons of each of these?
1 Direct templating with property
<div>Hello, {{user.name}}</div>
2 ng-bind-template with property
<div ng-bind-template="Hello, {{user.name}}"</div>
3 ng-bind with property
<div>Hello, <span ng-bind="user.name"></span></div>
4 Direct templating with function
<div>Hello, {{GetUserName()}}</div>
5 ng-bind-template with function
<div ng-bind-template="Hello, {{GetUserName()}}"</div>
6 ng-bind with function
<div>Hello, <span ng-bind="GetUserName()"></span></div>