I am new to angularjs and just wanted some help with filtering...
I understand the basics of filtering (which is very basic) but what I want to do is filter using multiple expressions.
HTML:
<body data-ng-init="phones = [{make:'Apple', model:'iPhone5'}, {make:'HTC', model:'One'}, {make:'Samsung', model:'GalaxyS4'}]">
<p>my first angular app</p>
<p><label>filter</label><input data-ng-model="phoneFilter.$" type="text"></p>
<ul>
<li data-ng-repeat="phone in phones | filter:phoneFilter">
{{phone.make}} {{phone.model}}
</li>
</ul>
</body>
Now if i filter 'apple' or 'iphone5' it works fine but if i type 'apple i' as soon as i start typing the model the filter is blank.
Do I need to create a custom filter for this?
Cheers
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…