Sunday, 8 September 2013

set up the filter in angular

set up the filter in angular

please help set up the filter http://jsfiddle.net/3pKXc/
object "news" has properties "title" and "teaser". #filter filter works
with both of them.
I need the filter to work only with the "title"
ps for example, to conduct the filter phrase "qwerty". shows that a
property id = 3 left in the list. wherein "qwerty" contained in "teaser"
code:
<input class="filter" id="filter" type="text" name="filter"
ng-model="searchText" />
<ul>
<li ng-repeat="item in newsVisible | filter:searchText">
<span class="date">{{item.date}}</span>
<span class="title">{{item.title}} - {{$index}}</span>
</li>
</ul>

No comments:

Post a Comment