これはスコープの問題のようですが、よくわかりません。私の目標は、テーブル内の 1 つの行を強調表示することです。これは、以前に強調表示された行が強調表示されていない状態に戻ることを意味します。行は、次のように ng-repeat ディレクティブで作成されます。
<div id="myFedContents" style="height:320px" ng-controller="Controller2" class="scroller">
<table border="0" class="span12 table table-condensed" style="margin-left:0px" id="tblData">
<thead>
<tr><th>Year</th><th>Name</th><th>Useful Flag</th></tr>
</thead>
<tbody id="allRows">
<tr ng-repeat="item in itemlist | filter:thisText" ng-style="myStyle"> <td class="span1" valign="top"><a tabindex="-1" href="#">{{item.year}}</a></td>
<td id="{{item.id}}"> <a tabindex="-1" href="#" ng-click="myStyle={'background-color':'#cccccc'};">{{item.name}}</a>
</td> <td>
<a href="#" class="btn btn-small btn-link">{{item.usefulflag}</a>
</td> </tr>
</tbody>
</table>
</div>
私は次のような.jsファイルにコードを持っています:
$("tr").mouseenter(function(){
alert("mouseenter");
});
テーブル ヘッダーの行はアラートに反応しますが、ng-repeat によって作成された行からの反応はありません。どうすれば修正できますか?