A similar question was asked here, but the one accepted answer doesn\'t really answer the question.
Using AngularFire, is it possible to to create relational-style datab
I have the best and quickest answer for all such kind of problems guys!!!
var chru;
var ref = new Firebase("https://myapp.firebaseio.com/users/");
var sync = $firebase(ref);
var users= syncSelect.$asArray();
$scope.users= users;
users.$loaded().then(function() {
chru = users.length;
});
$scope.specificIdOnSelect = function() {
var jj;
for (jj = 0; jj < chru; jj++) {
var keyer = users.$keyAt(jj);
var rec = users.$getRecord(keyer);
if ($scope.userSelected== rec.name) {
alert("Unique Key of " + $scope.users+ " is " + users.$keyAt(jj));
}
}
};
$scope.allIds = function() {
var jj;
for (jj = 0; jj < chru; jj++) {
var keyer = users.$keyAt(jj);
var rec = users.$getRecord(keyer);
alert("Unique Key of " + $scope.users+ " is " + users.$keyAt(jj));
}
};
Try it and then please let me know if this helps!!!