dimanche 13 avril 2014

Filtering a Firebase Object by another Firebase Object


Vote count:

0




So i have a big firebase list that I want to filter using another firebase object that I am binding to. If I do not bind my 'search' object to firebase it filters just fine, but when i do bind to Firebase it returns zero results.


my controller:



.controller('TestResultsCtrl', ['$scope', 'syncData', '$routeParams', '$firebase', '$filter', function($scope, syncData, $routeParams, $firebase, $filter) {
$scope.id = $routeParams.id;
syncData('tests/' + $routeParams.id).$bind($scope, 'test');
syncData('tests/' + $routeParams.id + '/specs').$bind($scope, 'search');
syncData('diagnoses').$bind($scope, 'all_diagnoses');
}])


my view:



<a href="" ng-repeat="diagnoses in all_diagnoses | orderByPriority | filter:search" class="list-group-item">{{diagnoses.title}}</a>


a sample 'search' object:



{
"constant": false,
"intermittent": true,
"localized": false,
"referred": true,
"region": "hip"
}


a sample 'diagnoses' object:



{
"constant": true,
"intermittent": false,
"localized": false,
"referred": true,
"region": "neck",
"title": "Whiplash"
}


How do I get this to filter correctly?



asked 48 secs ago






Aucun commentaire:

Enregistrer un commentaire