I have a javascript object and want to use angular's filter on a specific deep property but it does not seem to work.
function MyCtrl($scope, $filter)
{
$scope.items = [
{id:{val:1,str:'abc'}, name:'John'},
{id:{val:2,str:'abcd'}, name:'John'},
{id:{val:3,str:'xyz'}, name:'John'},
{id:{val:4,str:'axcvb'}, name:'John'},
{id:{val:5,str:'qwe'}, name:'John'}];
$scope.items2 = $scope.items;
$scope.$watch('search', function(param)
{
$scope.items = $filter('filter')($scope.items2, {id:{val:param}},false);
});
};
here is the fiddle http://jsfiddle.net/Lhhetazm/2/
If i just say,
$scope.items = $filter('filter')($scope.items2, {id:param},false);
Then it works but it searches the whole object which is not what i want, and i want it to work for partial searchs so i set the exact match flag to false
I am trying to develope a e-learning site for kids. It contains an excercise to select the right answer among the given four options,by seeing the clue image. When the kid selects the right answer,the ...
I am trying to develope a e-learning site for kids. It contains an excercise to select the right answer among the given four options,by seeing the clue image. When the kid selects the right answer,the ...
I'm using Cors requests to communicate between my client and server placed in two different domain. I configurate my apache http server this way it's using SSL : //with AJAX withCredentials=true (...
I'm using Cors requests to communicate between my client and server placed in two different domain. I configurate my apache http server this way it's using SSL : //with AJAX withCredentials=true (...
Im using dropzonejs to upload photos to my website. The problem is, when I click dropzone to upload, it won't show 'Gallery' as an option as seen in this image : How to add Gallery as an option?
Im using dropzonejs to upload photos to my website. The problem is, when I click dropzone to upload, it won't show 'Gallery' as an option as seen in this image : How to add Gallery as an option?
I am trying to implement a chat application using the codeigniter framework but on form submit, the form data does not get submitted and the submit button becomes disabled. when I check on the ...
I am trying to implement a chat application using the codeigniter framework but on form submit, the form data does not get submitted and the submit button becomes disabled. when I check on the ...