I\'ve got a page in my AngularJS app in which I would like to include the same html partial, but with different variables. If I do this in my main html:
Specifically, ng-init and onload expressions are evaluated in the parent scope, not the child scope created by the nginclude. Thus you are assigning values to var on the parent scope twice, both of which are happening before the content inside those ng-includes is loaded compiled and evaluated. When each child scope is created it inherits from the parent scope, where var='B'.