In the code below, when I'm using filter:filterText all the 3 parameters are getting filtered. If I want any of the two parameters to be filtered what expression can I use there?
<div ng-controller="someController">
<input type="text" ng-model="filterText"></input>
<ul>
<li ng-repeat="friend in friends|filter:filterText">
({{friend.name}},{{friend.phone}},{{friend.mail}})
</li>
</ul>
</div>
<script type="text/javascript">
var myapp1=angular.module("myApp",[]);
myapp1.controller("someController",function($scope,$filter){
$scope.friends=[
{
name:"asdf",
phone:"123456",
mail:"[email protected]"
},
{
name:"qwe",
phone:"456887",
mail:"[email protected]"
},
{
name:"cvb",
phone:"7786887",
mail:"[email protected]"
}
];
});
</script>