Angularは、ソースオブジェクトの深いコピーを実行するオブジェクト(ソース、宛先)をコピーできるAPIを提供します。
以下のポイントは、使用する場合に注意する必要があります。
使用例を見てみましょう。
<html> <head> <Meta http-equiv = "content-type" content = "text/html; charset = utf-8"/> <script src = "http://apps.bdimg.com/libs/angular.js/1.2.16/angular.min.min.min.min.min.min.min.min.min.min.min.min.min.min.min.min.min.min.min.min.min.min.min.min.min.min.min.min.min.min.min.min.min.min.min.min.min.min.min.min.min. <div ng-controller = "examplecontroller"> <form novalidate> name:<input type = "text" ng-model = "user.name" /> <br /> e-mail:<入力タイプ= "email =" email "ng-model =" user.email " />> <br /> gender:<input =" ng-model = "user" /> "base" type = "radio" ng-model = "user.gender" value = "female"/> lemamy <br/> <button ng-click = "reset()"> reset </button> <button ng-click = "update(user)"> save </button> </form> <pre> form = {user | json}} </pre> <pre> master = {{master | json}} </pre> </div> <script> angular.module( 'copyexample'、[]).controller( 'examplecontroller'、['$ scope'、function($ scope){$ scope.master = {}; var test1; console.log(angular.log(test1);/define var; console.log(angular.copy(test2)); Angular.cope.master.log.log($ scope.user); </script> </body> </html>上記は、AngularJS APIのコピーの情報を編集しています。今後も関連情報を追加し続けます。このウェブサイトへのご支援ありがとうございます!