Hi,

Thanks but that's not what I need, I'll try to explain what I'm doing 
because I wasn't very clear.

I have a global service, this service is initialized with configuration 
data corresponding to routes. In this service I have subscribed to router 
(router.subscribe), in the process I detect the new route and set a data 
into an observable. I want this behavior for all of my routes and it's 
working fine if I'm only doing this. But then I have a special case, in 
some route I want to dynamically override the data defined by the service, 
for this I have defined a setter, and change the data in the route ngOnInit 
process. But the problem is that ngOnInit occurs before router.subscribe 
event, so my local data is always overrided by the default service data. 
What I want to do is to be able to set the default data in the service 
before the route is actually initialized.
I've tried to put my route logic in ngAfterInitViews, but it still occurs 
before the router.subscribe event.

I don't want to use onActive or onDeactivate because this means I have to 
plug the service in all my routes for the default behavior which could lead 
to errors, and would be painful to maintain. I want to only plug the 
service when I need a different behavior.

So what I need is to trigger an action on *all *routes changes but *before *any 
the route is initialized because. 

Do you have another Idea ?

Thanks.

-- 
You received this message because you are subscribed to the Google Groups 
"AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.

Reply via email to