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

ng-repeat doesn't get rid of missing elements when the expression is changed #4276

Closed
guinnberg opened this issue Oct 4, 2013 · 3 comments
Closed

Comments

@guinnberg
Copy link

I took the angular's webpage example to show what's happening: http://plnkr.co/edit/hXKOn6uAt8RnGl6nq8rK?p=preview

If you use ng-include (I guess any directive which creates a new scope) inside the repeat it takes the changes, but doesn't get rid of the missed elements.

I'm not completely sure if this is really a bug or is something I'm doing wrong...

@xrg
Copy link

xrg commented Oct 4, 2013

On Friday 04 October 2013, IVO_ wrote:

I took the angular's webpage example to show what's happening:
http://plnkr.co/edit/hXKOn6uAt8RnGl6nq8rK?p=preview

If you use ng-include (I guess any directive which creates a new scope)
inside the repeat it takes the changes, but doesn't get rid of the missed
elements.

I'm not completely sure if this is really a bug or is something I'm doing
wrong...

It's already been discussed in #3909

You have to break your <xx ng-repeat="..." ng-include="..."> element into
two elements: <xx ng-repat="..."><div ng-include="...">

@guinnberg
Copy link
Author

Thanks @xrg!

Anyway, I think it throw an error if you're including ng-include with ng-repeat (or any other which may affect) as it happens with ng-switch and ng-switch-when for example, don't you think?

@petebacondarwin
Copy link
Contributor

Closing as a duplicate of #3909

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