Multiple ng-init declarations on same element
I continuously use ng-init as a sort of variable declaration in templates, especially when formatting data for rendering. This nicely keeps view related things out of the controller.
When there is the need for multiple ng-inits but the DOM is relatively small the only (wrong) way is to create dummy elements just to contain the ng-init declarations. Currently Angular only evaluates one (the last one?) ng-init directive on one element, could it process multiple ones?
You should be able to evaluate multiple expressions in ng-init by separating them with ; --- I was just looking at the parser code the other day, and it looks like that should work.
No promises because that code is terribly hard to follow, but I think you should give that a try and see if it does it for you.
Worked like a charm, thanks! :)
woooow Really thank you Catip