AngularJSng-copyディレクティブ


入力フィールドのテキストがコピーされているときに式を実行します。

<input ng-copy="count = count + 1" ng-init="count=0" value="Copy this text" />

定義と使用法

ng-copyディレクティブは、HTML要素がコピーされているときに何をするかをAngularJSに指示します

AngularJSからのng-copyディレクティブは、要素の元のoncopyイベントをオーバーライドせず、ng-copy式と元のoncopyイベントの両方が実行されます。


構文

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

すべてのHTML要素でサポートされています。


パラメータ値

Value Description
expression An expression to execute when the text of an element is being copied.