AngularJSng-mouseenterディレクティブ


マウスカーソルが<div>要素に入ったときに式を実行します。

<div ng-mouseenter="count = count + 1" ng-init="count=0">Mouse over me!</div>

<h1>{{count}}</h1>

定義と使用法

ng-mouseenterディレクティブは、マウスカーソルが特定のHTML要素に入ったときに何をするかをAngularJSに指示します

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


構文

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

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


パラメータ値

Value Description
expression An expression to execute when the mouse cursor enters an element.