-
Notifications
You must be signed in to change notification settings - Fork 27.5k
Strange behavior with ng-repeat-start/end and ng-if in 1.1.6-a22596c #3104
Comments
Issue still present in angular-1.1.6-031da1f Here's a plunker: http://plnkr.co/ddTiumaNzxOyhs8iwBKN |
Found this issue before submitting a bug. In AngularJS v1.1.6-52123ae problem still exists. For me it looks like all tr's beside first (generated for every element on list used in ng-repeat) stay as orphans in table, when element list is cleared. Repeating list & clear operation, add new set of orphan rows. But in my case there is ng-show, not ng-if. |
@tunguski it works fine for me with a ng-show (plunkr). I seem to have understood what's causing the problem with
Since the element where
So When comes a time for You can see this more easily if you just have 1 record at a time: plunkr So the problem really is: when the comment of a directive with The best solution to the problem I could come up with is: Edit: Edit 2:
|
Ok, you're right, my case is different. It is probably related to inner ng-repeat. One plnkr will be worth a tousand words:
|
same problem in 1-2.0-rc2 ng-íf behaves unexpectedly, leaving the TR in the table, while if ng-show is used, works as expected |
Issue: multi-elements ng-repeat (ng-repeat-start, ng-repeat-end) can contain elements with a trancluding directive. This directive changes content of the row (template) and ng-repeat does not work correctly (when removing/moving rows), because ng-repeat works with the original template (elements). This changes ng-repeat behavior to traverse the DOM to find current elements everytime we are moving/removing rows (if the template has multiple elements). Closes angular#3104
Issue: multi-elements ng-repeat (ng-repeat-start, ng-repeat-end) can contain elements with a trancluding directive. This directive changes content of the row (template) and ng-repeat does not work correctly (when removing/moving rows), because ng-repeat works with the original template (elements). This changes ng-repeat behavior to traverse the DOM to find current elements everytime we are moving/removing rows (if the template has multiple elements). Closes angular#3104
Issue: multi-elements ng-repeat (ng-repeat-start, ng-repeat-end) can contain elements with a trancluding directive. This directive changes content of the row (template) and ng-repeat does not work correctly (when removing/moving rows), because ng-repeat works with the original template (elements). This changes ng-repeat behavior to traverse the DOM to find current elements everytime we are moving/removing rows (if the template has multiple elements). Closes angular#3104
When using ng-repeat-start/end to cover two consecutive
<tr>
s in a table, the latter having an additionalng-if
directive the data binding acts really strange. When adding items whileng-if
is true, the order of the rows change and ifng-if
is subsequently set to false, all new rows are kept in the DOM.Example: http://da024c74860939fa.paste.se
The text was updated successfully, but these errors were encountered: