डाउनलोड पी.डी.एफ. ई-बुक्स
AJS - Directives ng-copy

ng-copy directive ये जब किसी HTML Element का content copy(ctrl+c) किया जाता है तब दिया हुआ expression execute करता है |


Syntax for ng-copy Directive in AngularJS

<element ng-copy="expression">
</element>

ng-copy Attribute's Parameters in AngularJS

expression : यहाँ पर expression दिया जाता है |


Example for ng-copy Directive using String in AngularJS

Source Code :
<html>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.6.4/angular.min.js"></script>
</head>
<body>

<div ng-app = "">

<p ng-init="c = 0" ng-copy="c = c + 1" />
Copy Me.
</p>

<p>Copied {{c}} times.</p> 

</div>

</body>
</html>
Output :

Copy Me.

Copied {{c}} times.