What's alternative to angular.copy in Angular

后端 未结 15 1165
忘掉有多难
忘掉有多难 2020-11-29 00:43

How can I copy an object and lose its reference in Angular?

With AngularJS, I can use angular.copy(object), but I\'m getting some error using that in An

15条回答
  •  迷失自我
    2020-11-29 01:31

    If you are not already using lodash I wouldn't recommend installing it just for this one method. I suggest instead a more narrowly specialized library such as 'clone':

    npm install clone
    

提交回复
热议问题