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 was archived by the owner on Apr 12, 2024. It is now read-only.
I discovered this issue when I tried access the injector within my app. The use case was to manipulate my app interactively for debugging and testing purposes.
The ngApp directive is defined within a server-side template (thymeleaf) and to keep each template language clean I used the ngInclude directive to load a base template for my app.
... BUT it took a really long time to find the cause of this problem. The trap is that it's very likely that month go by after the initial setup of an app and the point where interactive debugging will be done.
Therefore the problem should be either fixed, or angular should warn if ngApp and ngInclude are used on the same element.
OK, so I think there the resolution to this issue is to add a note to the ngApp documentation saying that you should not use it on the same element as a directive that has element transclusion, listing some of the common ones.
An additional solution is to print some kind of warning to the console, if the compile finds a directive with element transclusion on the $rootElement. I would prefer not to do this, though.
- Note that bootstrapping on elements with transclusion directives
is dangerous and not recommended.
- group info on limitations, and add them to the guide
Closesangular#11421Closesangular#13572Closesangular#12583
Narretz
added a commit
to Narretz/angular.js
that referenced
this issue
Feb 8, 2016
- Note that bootstrapping on elements with transclusion directives
is dangerous and not recommended.
- group info on limitations, and add them to the guide
Closesangular#11421Closesangular#13572Closesangular#12583
Narretz
added a commit
to Narretz/angular.js
that referenced
this issue
Feb 9, 2016
- Note that bootstrapping on elements with transclusion directives
is dangerous and not recommended.
- group info on limitations, and add them to the guide
Closesangular#11421Closesangular#13572Closesangular#12583
I discovered this issue when I tried access the injector within my app. The use case was to manipulate my app interactively for debugging and testing purposes.
The
ngApp
directive is defined within a server-side template (thymeleaf) and to keep each template language clean I used thengInclude
directive to load a base template for my app.Everything worked fine, until I tried to get an injector for the app and got undefined.
After a lot of debugging I discovered that the directives on the same element cause the problem. The fix was quite simple...
... BUT it took a really long time to find the cause of this problem. The trap is that it's very likely that month go by after the initial setup of an app and the point where interactive debugging will be done.
Therefore the problem should be either fixed, or angular should warn if
ngApp
andngInclude
are used on the same element.Plunker Example to reproduce the behavior: http://embed.plnkr.co/JD3vDJJrjm9MMyyXT7W3/preview
Related Issue: #10556
The text was updated successfully, but these errors were encountered: