-
Notifications
You must be signed in to change notification settings - Fork 27.5k
ng-if breaks when used inside a custom directive together with templateUrl #7183
Comments
it's also related to the directive using 'replace:true' |
it's also related to the template being loaded from here's a bit less complicated reproduce example: http://plnkr.co/edit/IboruW7Dku1hTnPOFMI2?p=preview |
This is not fixed by #7387 |
@shahata's plunker is still broken on master but it doesn't break if you wrap the cached template contents (i.e. the bit with the ng-if) in a div: http://plnkr.co/edit/IboruW7Dku1hTnPOFMI2?p=preview |
@petebacondarwin are you looking into this one? |
I've spent some time on it with no progress so far. Could benefit from some
|
@petebacondarwin I enjoy hacking on the compiler, so if you need some help with it don't hesitate to ask. Unless anyone else is in your timezone at the moment, in which case they'd probably be better. |
If a "replace" directive has an async template, which contains a transclusion directive at its root node, then outer transclusions were failing to be passed to this directive. An example would be uses of `ngIf` inside and outside the template. Collaborated with @caitp Closes angular#7183 Closes £7772
If a "replace" directive has an async template, which contains a transclusion directive at its root node, then outer transclusions were failing to be passed to this directive. An example would be uses of `ngIf` inside and outside the template. Collaborated with @caitp Closes angular#7183 Closes £7772
If a "replace" directive has an async template, which contains a transclusion directive at its root node, then outer transclusions were failing to be passed to this directive. An example would be uses of `ngIf` inside and outside the template. Collaborated with @caitp Closes angular#7183 Closes £7772
Looks like #7772 fixes this bug: http://plnkr.co/edit/DY6zCe0pPi9EpO2K3Ee1?p=preview |
If a "replace" directive has an async template, which contains a transclusion directive at its root node, then outer transclusions were failing to be passed to this directive. An example would be uses of `ngIf` inside and outside the template. Collaborated with @caitp Closes angular#7183 Closes angular#7772
ng-if does not work when used inside a custom directive and the template is specified using templateUrl. When the custom directive template is specified directly using the "template" parameter then there is no problem. Additionally this problems happens only if the custom directive is inside a ng-repeat.
The bug is reproducible with Angular 1.2.16. A possible workaround is to use ng-show instead.
Sample: http://codepen.io/anon/pen/mdFAo/?editors=101
The text was updated successfully, but these errors were encountered: