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

Bug using ngForm and ngRepeat on the same node #12561

Closed
kwypchlo opened this issue Aug 12, 2015 · 1 comment
Closed

Bug using ngForm and ngRepeat on the same node #12561

kwypchlo opened this issue Aug 12, 2015 · 1 comment

Comments

@kwypchlo
Copy link
Contributor

consider this example:

<table ng-controller="TestController as ctrl">
    <tbody>
        <tr ng-repeat="person in ctrl.people" ng-form="testForm">
            <td>{{ person.name }}</td>
            <td><button type="button" ng-click="ctrl.remove($index)"></button></td>
        </tr> 
    </tbody>
</table>
function TestController() {
    this.people = [
        {name: 'John'},
        {name: 'Dorothy'},
        {name: 'Charles'}
    ];

    this.remove = function(index) {
        this.people.splice(index, 1);
    }
}

Using remove button fires up the remove function from the controller, removes one person from the people collection but the row remains displayed, yet without any data. Removing ngForm directive from the <tr> that has ngRepeat resolves the issue, however I need that ngForm there in my case :)

I couldn't get a fiddle or codepen working, dunno why but the example should be simple enough. Tested on 1.4.1 but haven't seen any changes since then in changelog that could suggest it was fixed anyhow.

@Narretz
Copy link
Contributor

Narretz commented Aug 12, 2015

This is a dupe of #12161. I hope we can a fix (see #12271) into 1.4.4 or 1.4.5

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

2 participants