TypeError: object is not a function at new <anonymous>

This question already has an answer here:

  • What is the most efficient way to deep clone an object in JavaScript? 57 answers

  • $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.

    链接地址: http://www.djcxy.com/p/6956.html

    上一篇: 创建一个新对象,而不是引用

    下一篇: TypeError:对象不是新的<anonymous>函数