Created
February 11, 2015 12:22
-
-
Save Epotignano/ff93c3061fc2a6c9cb85 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
serv.match = function(collection,propertyToMatch, query) { | |
var sync; | |
/*if(propertyToMatch.indexOf(".") != -1) { | |
var properties = propertyToMatch.split("."); | |
sync = $firebase(ref.child(collection).child(properties[0]).child(properties[1]).orderByChild(properties[1]).startAt(query).endAt(query+"~")); | |
} else {*/ | |
sync = $firebase(ref.child(collection).orderByChild(propertyToMatch).startAt(query).endAt(query+"~")); | |
// } | |
var matchPromise = $q.defer(); | |
var record = sync.$asObject(); | |
record.$loaded().then(function(data) { | |
matchPromise.resolve(data); | |
}); | |
return matchPromise.promise; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment