angularjs - ng-filter with filter is not filtering -
hi i'm trying filter list of objects in array , displaying it. filtering based on users input input field.
i've had @ number of questions on stackoverflow, feel different- since data in array. html:
<body ng-app="myapp"> <div ng-controller="myctrl"> <form class="form-inline"> <input ng-model="search" type="text" placeholder="filter by" autofocus> </form> <div ng-repeat="f in feedbacklist | filter:search "> <div>{{f.jobid}}</div> </div> </div> </body>
js:
var app = angular.module("myapp", []); app.controller("myctrl", function($scope) { $scope.search = ""; $scope.feedbacklist = [ { jobid: "1432", feedbackid: "342342", profileurl: "assets/img/profiles/avatar_small2x.jpg", address: "24 mathers st, smithswood", name: "jorem ipsum", initials: "jp", content: "lorem ipsum dummy text of printing , typesetting industry. lorem ipsum has been industry's standard dummy text ever since 1500s, when unknown printer took galley of type , scrambled make type specimen book. has survived not 5 centuries, leap electronic typesetting, remaining unchanged. popularised in 1960s release of letraset sheets containing lorem ipsum passages, , more desktop publishing software aldus pagemaker including versions of lorem ipsum.", date: "23/05/2016", message: "", replies: [ { jobid: "1232", feedbackid: "342342", profileurl: "assets/img/profiles/avatar_small2x.jpg", address: "24 mathers st, smithswood", name: "jorem ipsum", initials: "jp", content: "lorem ipsum dummy text of printing , typesetting industry. lorem ipsum has been industry's standard dummy text ever since 1500s, when unknown printer took galley of type , scrambled make type specimen book. has survived not 5 centuries, leap electronic typesetting, remaining unchanged. popularised in 1960s release of letraset sheets containing lorem ipsum passages, , more desktop publishing software aldus pagemaker including versions of lorem ipsum.", date: "23/05/2016", }, { jobid: "1232", feedbackid: "342342", profileurl: "assets/img/profiles/avatar_small2x.jpg", address: "24 mathers st, smithswood", name: "jorem ipsum", initials: "jp", content: "lorem ipsum dummy text of printing , typesetting industry. lorem ipsum has been industry's standard dummy text ever since 1500s, when unknown printer took galley of type , scrambled make type specimen book. has survived not 5 centuries, leap electronic typesetting, remaining unchanged. popularised in 1960s release of letraset sheets containing lorem ipsum passages, , more desktop publishing software aldus pagemaker including versions of lorem ipsum.", date: "23/05/2016", } ], }, { jobid: "1232", feedbackid: "342342", profileurl: "", address: "24 mathers st, smithswood", name: "jorem ipsum", initials: "jp", content: "lorem ipsum dummy text of printing , typesetting industry. lorem ipsum has been industry's standard dummy text ever since 1500s, when unknown printer took galley of type , scrambled make type specimen book. has survived not 5 centuries, leap electronic typesetting, remaining unchanged. popularised in 1960s release of letraset sheets containing lorem ipsum passages, , more desktop publishing software aldus pagemaker including versions of lorem ipsum.", date: "23/05/2016", message: "", replies: [ ], }, ]; });
i've created fiddle here
this code don't find issue code. thing want know on property in object want filter?
if want filter 'jobid' use code filter:{jobid:search}
Comments
Post a Comment