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.js"> </head <ng-app = "" <div ng-controller = "examplecontroller"> <form novalidate> name : <input type = "text"ng-model = "user.name" /> <br /> 이메일 : <input type = "email"ng-model = "user.email" /> <br /> gender : <value = "user.gender ="user.gender = "ng-model. <입력 유형 = "radio"ng-model = "user.gender"value = "female"/> female <br/> <button ng-click = "reset ()"> reset </button> <button ng-click = "update (user)"> 저장 </button> </form> <pre> form = {{user | json}} </pre> <fre> 마스터 = {{마스터 | json}} </pre> </div> <cript> angular.module ( 'CopyExample', []) .controller ( 'emabestecontroller', [ '$ scope', function ($ scope) {{{}; var test1; console.log (angular.copy (test1)); // var test3; Console.log (angular.copy (test2) Angular.copy.master, $ scope.log. </script> </body> </html>위는 AngularJS API의 사본 정보를 편집 한 것입니다. 우리는 향후 관련 정보를 계속 추가 할 것입니다. 이 웹 사이트를 지원 해주셔서 감사합니다!