Reset a model with angular.js

前端 未结 7 893
一生所求
一生所求 2020-12-02 17:03

I\'m simply try to reset values like this :

$scope.initial = [
    {
        data1: 10,
        data2: 20
    }            
];


$scope.datas= $scope.initial         


        
相关标签:
7条回答
  • 2020-12-02 18:00

    Try changing the reset function to use angular.copy

    $scope.reset = function () {
        $scope.datas = angular.copy($scope.initial);
    };
    
    0 讨论(0)
提交回复
热议问题