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

ng-repeat-start doesn't clean old view when model change #3925

@khtwo

Description

@khtwo

angular-1.2.0-rc.2

<div data-ng-cloak="" data-ng-controller="Controller">
    <a data-ng-click="changeItems1()">Change Items1</a>

    <div data-ng-repeat-start="item1 in model1.items1" style="width:0;height:0;">
    </div>
    <div data-ng-repeat="item2 in model1.items2" style="border:1px #f00 solid;">
        {{ item1 }}, {{ item2 }}
    </div>
    <div data-ng-repeat-end style="display:none;">
    </div>
</div>

<script type="text/javascript">
    function Controller($scope){
        $scope.model1 = {};
        $scope.model1.items1 = [{id:"1"}, {id:"2"}, {id:"3"}, {id:"4"}];
        $scope.model1.items2 = [{id:"1a"}, {id:"2a"}, {id:"3a"}];

        $scope.changeItems1 = function(){
            $scope.model1.items1 = [{id:"1"}, {id:"2"}, {id:"3"}];
        }
    }
</script>

When click "Change Items1", the old rendered boxes were not get clean up.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions