You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Apr 12, 2024. It is now read-only.
The documentation on ng-init spells this out, but in terms newbies will have a hard time to understand. Maybe this could be clarified, preferably with a big warning sign?
In any case, Angular has directives as a method of modularization and ng-include. Directives have a relatively high overhead to set up, so ng-include seems the simpler alternative. But to effectively modularize your templates, you need to set up the scope for an ng-include, i.e. bind certain properties to what the included template expects. The first thing that comes to mind is ng-init, but that does not work due to not being live.
As far as I can tell there's no way in Angular to set up the scope for an included template. Could we have that? Is it possible to write an ng-include that takes additional attributes for its scope, or just a generic ng-init that is live?
The text was updated successfully, but these errors were encountered:
ng-init is not live, it'll only bind once a new scope is created: http://jsfiddle.net/mprobst/gVeS3/
The documentation on ng-init spells this out, but in terms newbies will have a hard time to understand. Maybe this could be clarified, preferably with a big warning sign?
In any case, Angular has directives as a method of modularization and ng-include. Directives have a relatively high overhead to set up, so ng-include seems the simpler alternative. But to effectively modularize your templates, you need to set up the scope for an ng-include, i.e. bind certain properties to what the included template expects. The first thing that comes to mind is ng-init, but that does not work due to not being live.
As far as I can tell there's no way in Angular to set up the scope for an included template. Could we have that? Is it possible to write an ng-include that takes additional attributes for its scope, or just a generic ng-init that is live?
The text was updated successfully, but these errors were encountered: