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

[ng-include] and [ng-repeat] behaving unexpectedly #3849

Closed
filiptc opened this issue Sep 3, 2013 · 4 comments
Closed

[ng-include] and [ng-repeat] behaving unexpectedly #3849

filiptc opened this issue Sep 3, 2013 · 4 comments

Comments

@filiptc
Copy link

filiptc commented Sep 3, 2013

I've recently updated my project from angular 1.1.5 to 1.2.0rc1 and I'm having some serious issues with ngrepeat combined with nginclude when used both on the same element.

On 1.1.5 pushing elements onto the repeat subject works as expected, while on 1.2.0rc1 both directives don't play well together (i.e. they don't play at all).

When using the snapshot version, both work again but produce unexpected behavior, as the newly pushed items get added above the currently displayed ones instead of below.

Be sure to check the plunkers below where I wrote the same example for each version (ignore 1.2.0rc1 which I added for completeness' sake, even though functionality breaks):

@wesleycho
Copy link
Contributor

I've run into this exact issue when upgrading from 1.1.5 to 1.2.0rc1 as well - this completely breaks an app I have.

Edit: Looks like this issue is fixed in master

@jankuca
Copy link
Contributor

jankuca commented Sep 3, 2013

The workaround is to use ngInclude on a descendant. We introduced a few changes to the core that make it nearly impossible to use both of these directives on a single element.

@jankuca jankuca closed this as completed Sep 3, 2013
@filiptc
Copy link
Author

filiptc commented Sep 4, 2013

Note taken. Beware that as of actual master, behavior is completely unexpected and therefore sort of buggy. IMO, the incompatibility of both directives on one element should probably be documented in the future.

@jankuca
Copy link
Contributor

jankuca commented Sep 4, 2013

Yes, ngInclude will probably be throwing exceptions in this situation.

On Wednesday, September 4, 2013 at 12:45 AM, Philip Thomas Casado wrote:

Note taken. Beware that as of actual master, behavior is completely unexpected and therefore sort of buggy. IMO, the incompatibility of both directives on one element should probably be documented in the future.


Reply to this email directly or view it on GitHub (#3849 (comment)).

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants