To answer your question, $loaded returns a promise , so the simplest answer here would be to return it from your service to worry about $ q and all that.
It seems that this whole premise is erroneous here and that this is an XY problem. It seems that a few hacks designed to undermine the intended use of these libraries and as a good, solid read of Angular walkthrough and AngularFire Guide will save a ton of unnecessary complexity here.
Using the factory here is subversive and closely related. The syntax is invalid and does not compile. And ultimately, the goal is to add a search method to the synchronized array returned from AngularFire, which must be executed using $ extendFactory.
app.factory('firebaseRef', function(FIREBASE_URL) { return function(path) { var ref = new Firebase(FIREBASE_URL); if( path ) { ref = ref.child(path); } return ref; } }); app.factory('SearchableArray', function($firebase, $FirebaseArray) { var ArrayWithSearch = $FirebaseArray.$extendFactory({ searchByEmail: function(emailAddress) { var res = null; for(var i=0, len=this.$list.length; i < len; i++ ) { if( this.$list[i].email === emailAddress ) { res = this.$list[i]; break; } } return res; } }); return function(ref) { return $firebase(ref, {arrayFactory: ArrayWithSearch}).$asArray(); } }); app.controller('Controller', function($scope, SearchableArray, firebaseRef) { $scope.data = SearchableArray( firebaseRef('abc/def') ); $scope.search = function(email) { console.log( $scope.data.searchByEmail(email) ); }; });
source share