Hi all,

I have a question regarding Angular2:

Is there a way to access all currently active components? My usecase would 
be to iterate all active components and ask them if they contain unsaved 
data before letting the router change to a new route.
An ideal solution would look like this:

IHasDirty {
   isDirty
} 

@Component
MyComponent implements IHasDirty {
}


$ComponentRegistry.activeComponentsImplementingInterface(IHasDirty).forEach(component
 
=> { if (component.isDirty) { ... } )}
 


Thanks,

    Pelle

-- 
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