Skip to content

Commit

Permalink
Merge pull request #86 from xialvjun/patch-1
Browse files Browse the repository at this point in the history
Update Chapter2.markdown
  • Loading branch information
basecss committed Dec 9, 2013
2 parents 244fa42 + 1949b1d commit ded6dbc
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Chapter2.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -599,7 +599,7 @@
在模版中, 我们设置`ng-class``{selected: $index==selectedRow}`. 当模型中的`selectedRow`属性匹配ng-repeat的`$index`时设置class为selected. 我们还设置一个`ng-click`来通知控制器用户点击了哪一行:
```html
<table ng-controller="RestaurantTableController">
<tr ng-repeat="restaurant in directory" ng-click="selectRestaurant($index)" ng-class="{selected: $index==selectedRow">
<tr ng-repeat="restaurant in directory" ng-click="selectRestaurant($index)" ng-class="{selected: $index==selectedRow}">
<td>{{restaurant.name}}</td>
<td>{{restaurant.cuisine}}</td>
</tr>
Expand Down

0 comments on commit ded6dbc

Please sign in to comment.