Skip to content

Commit fc29dc3

Browse files
committed
Add a feature that set the keywords as tag when you click a tag
1 parent 4dac231 commit fc29dc3

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

app/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ <h3>
1919
<a target="_blank" ng-href="{{ word.url?word.url: 'http://www.dict.cn/' + word.word }}" ng-bind="word.word"></a>
2020
</h3>
2121
<span class="tag-box">
22-
<em ng-repeat="tag in word.tags track by $index" ng-bind="tag"></em>
22+
<em ng-repeat="tag in word.tags track by $index" ng-bind="tag" ng-click="setKeywords(tag)"></em>
2323
</span>
2424
</li>
2525
</ul>

app/scripts/app.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,5 +25,9 @@ angular.module('abstackVarLib', [])
2525
$scope.wordsList = data;
2626
});
2727

28+
$scope.setKeywords = function(tag){
29+
$scope.keywords = tag;
30+
}
31+
2832

2933
}]);

0 commit comments

Comments
 (0)