angular.copy Function – It basically creates the copy of the source array or object. The syntax for angular copy function is angular.copy(source, [destination]); where source will be copied into destionation.
source and destionation both must be of the same type.
Here in this tutorial we are going to explain the ng function component with example and demo. You can use our online editor to edit and run the example.
angular.copy Syntax | Example | Demo
Syntax
Syntax of angular copy function is as –
angular.copy Syntax :
angular.copy(source, [destination]); |
Arguments
- source(Any Type) – Source to be copied. It can be any type – null, undefined or array.
- destination(object or array) – Destination to which source to be copied. It must be object or array.
Example
Here is simple example of angular copy function-
angular.copy Example :
<div ng-app="myApp"> <div ng-controller="myController"> </div> </div> <p><br/> </p> |