How to push objects in AngularJS between ngRepeat arrays

前端 未结 3 1618
无人共我
无人共我 2021-01-31 03:14

So I\'m new to AngularJS and I\'m trying to build a very simple list app, where I can create an ng-repeat item list and then push a selected item into another ng-repeat list. Al

3条回答
  •  被撕碎了的回忆
    2021-01-31 04:00

    change your method to:

    $scope.toggleChecked = function (index) {
        $scope.checked.push($scope.items[index]);
        $scope.items.splice(index, 1);
    };
    

    Working Demo

提交回复
热议问题