TypeError: object is not a function at new <anonymous>
This question already has an answer here:
$scope.persons.push(angular.copy($scope.person));
$scope.persons.push(angular.copy($scope.person));
you need a copy of a person
object , you cant use new
keyword with it
in java, you can use class
to create a object, after creating a object you can deal with it, but you cant create a new object from the object. like wise $scope.person
is a object. you cant use new
keyword with it.
上一篇: 创建一个新对象,而不是引用