I'm integrating firebase with AngularJS, and I'm having some trouble using the result of a firebase snapshot in a promise.
Below is the code in one of my states in ui-router:
resolve: {
opinionConfig: function($stateParams, $location, $q, ConstantsService) {
var result = $q.defer();
var processResponse = function(value) {
value.opinion = $stateParams.opinion;
result.resolve(value);
};
var rootRef = new Firebase(ConstantsService.FIREBASE_URL + 'configs/' + $stateParams.opinion);
rootRef.once('value', function(snapshot) {
if (snapshot.val() === null) {
$location.path('/');
// console.log("configs doesn't exist.");
result.reject("configs doesn't exist");
} else {
// console.log("configs does exist: " + snapshot.val());
processResponse(angular.copy(snapshot.val()));
}
});
return result.promise;
}
}
and I'm getting this error in firefox's developer tools.

and this is what I get in Chrome's developer tools.

It seems like the two errors are different, and I couldn't find an official un-minified version of firebase.js, so I wasn't sure where exactly this is being thrown.
Thanks,
Luke