Angular provides a api--copy (source,destination) that can replicate objects, and it performs a deep copy of the source object.
The following points need to be noted when using:
If there is only one argument (an object that does not specify a copy), a copy object is returned
If destination is specified, a deep copy of the object is copied to destination
If source is null or undefined, then the source is returned directly
If source is desitination, then the error will be.
Le
Angularjs Extend Usage
Angular.extend: Assigns the first-level property of the second parameter and subsequent arguments, whether simple or object, to the first-level property of the first argument, that is, if it is an object, refers to the same object and returns the first parameter object.
Instance one: var r = angular.extend (b, a); assigns the first-level property of object A (whether a simple property or an object) to the first-level property
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.