I\'d like to have my angularFire
collection resolve on route loading. Something like:
App.config ($routeProvider, angularFireProvider) ->
$rout
I'm not exactly sure why you want the collection to resolve on route loading, as opposed to in the controller - could you elaborate? For example, the following would work too:
App.config ($routeProvider, angularFireProvider) ->
$routeProvider.when '/test',
controller: 'TestCtrl'
function TestCtrl($scope, angularFire) {
angularFire("https://.firebaseio.com", $scope, "collection").
then(function() {
// The collection has been resolved and available in $scope.collection
});
}
Is it mainly a matter syntactic convenience or am I missing functionality you want in the above?
Update: For the value to be resolved before the $routeChangeSuccess
event is fired:
App.config(['$routeProvider', 'angularFire', function($routeProvider, angularFire) {
$routeProvider.when("/test", {
templateUrl: 'views/test.html'
controller: 'TestCtrl',
resolve: {collection: angularFire("https://.firebaseio.com")}
});
}]);
function TestCtrl(collection) {
// collection has already been resolved to its value.
}