Skip to content
This repository has been archived by the owner on Apr 12, 2024. It is now read-only.

Ng-include inside ng-switch duplicates #3893

Closed
nesteant opened this issue Sep 5, 2013 · 6 comments
Closed

Ng-include inside ng-switch duplicates #3893

nesteant opened this issue Sep 5, 2013 · 6 comments

Comments

@nesteant
Copy link

nesteant commented Sep 5, 2013

When ng-include directive is placed inside ng-switch directive it is included each time ng-switch iteration. Reproduced in 1.2 rc1

@NathanWalker
Copy link

You might want to try 1.2 rc2, which was released yesterday... I believe the issue you have reported is for 1.2 rc1 and has been fixed. Please check with latest.

@petebacondarwin
Copy link
Member

@nesteant - can you provide a running example of the problem?

@wcandillon
Copy link

Could this issue be related to https://groups.google.com/forum/#!topic/angular/IhV_FApq-A4 ?

@clouddueling
Copy link
Contributor

Maybe some clues:

  • Initially I only have one ng-include nested within ng-view.
  • ng-include's src has a variable in it. currentPage + ".html"
  • When I switch this var I end up with two ng-includes, then I switch again and I have three, then four, and so on.

But my other ng-include that has a var init OUTSIDE of the ng-view works fine.

EDIT
4 solved my issue: #3584 (comment)

@petebacondarwin
Copy link
Member

@nesteant - did #3584 solve your problem too?

@IgorMinar
Copy link
Contributor

the problem right now is that we don't abort the compilation and issue an error when two different element transclusion directives with different priorities are applied to the same element (e.g. ng-switch-when + ng-include). We should fix that. @jankuca has tried to address this, but his fix is not good and I'm working on an alternative.

@ghost ghost assigned IgorMinar Oct 10, 2013
vojtajina pushed a commit to vojtajina/angular.js that referenced this issue Oct 11, 2013
IgorMinar added a commit to IgorMinar/angular.js that referenced this issue Oct 11, 2013
Issue an error and abort compilation when two directives that ask for transclusion are found
on a single element. This configuration is not supported and we previously failed to issue
the error because in the case of element transclusion the compilation is re-started and this
caused the compilation context to be lost.

The ngRepeat directive has been special-cased to bypass this warning because it knows how to
handle this scenario internally.

This is not an ideal solution to the problem of multiple transclusions per element, we are
hoping to have this configuration supported by the compiler in the future. See angular#4357.

Closes angular#3893
Closes angular#4217
Closes angular#3307
IgorMinar added a commit to IgorMinar/angular.js that referenced this issue Oct 12, 2013
Issue an error and abort compilation when two directives that ask for transclusion are found
on a single element. This configuration is not supported and we previously failed to issue
the error because in the case of element transclusion the compilation is re-started and this
caused the compilation context to be lost.

The ngRepeat directive has been special-cased to bypass this warning because it knows how to
handle this scenario internally.

This is not an ideal solution to the problem of multiple transclusions per element, we are
hoping to have this configuration supported by the compiler in the future. See angular#4357.

Closes angular#3893
Closes angular#4217
Closes angular#3307
jamesdaily pushed a commit to jamesdaily/angular.js that referenced this issue Jan 27, 2014
Issue an error and abort compilation when two directives that ask for transclusion are found
on a single element. This configuration is not supported and we previously failed to issue
the error because in the case of element transclusion the compilation is re-started and this
caused the compilation context to be lost.

The ngRepeat directive has been special-cased to bypass this warning because it knows how to
handle this scenario internally.

This is not an ideal solution to the problem of multiple transclusions per element, we are
hoping to have this configuration supported by the compiler in the future. See angular#4357.

Closes angular#3893
Closes angular#4217
Closes angular#3307
jamesdaily pushed a commit to jamesdaily/angular.js that referenced this issue Jan 27, 2014
Issue an error and abort compilation when two directives that ask for transclusion are found
on a single element. This configuration is not supported and we previously failed to issue
the error because in the case of element transclusion the compilation is re-started and this
caused the compilation context to be lost.

The ngRepeat directive has been special-cased to bypass this warning because it knows how to
handle this scenario internally.

This is not an ideal solution to the problem of multiple transclusions per element, we are
hoping to have this configuration supported by the compiler in the future. See angular#4357.

Closes angular#3893
Closes angular#4217
Closes angular#3307
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

7 participants