I am trying to load a group of messages depending on an ID that is part of the app's route. The routeParams object appears to be a promise, and I'm not sure how to set it up so that it waits until the routeParams object have loaded to load the group of messages:
var current = Messages.rest({m_gid:$routeParams.gid}).query({}, function () {
$scope.messages.current = Messages.messages.current = current.data;
});
I'm sure that this is simple, I'm just at a loss...
You can subscribe to the $routeChangeSuccess event.
$rootScope.$on('$routeChangeSuccess', function(event, current, previous){
//do work with $routeParams here
});
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With