This should work similar in Dart https://github.com/angular/angular/issues/4112#issuecomment-153811572
On Wednesday, August 10, 2016 at 7:53:24 AM UTC+2, Thomas Löffler wrote: > > Hello, > > I want to check a login before navigating to a component. In the TS > version there is the "AuthGuard"-Possibility, in Angular Dart there is a > @CanActivate annotation for the component. > > Unfortunately this decorator wants a anonymous function, completely > decoupled from the component and all injected services. > > My question is: How can I check things BEFORE the router navigates to a > component? > > I tried: > > 1. subscribing to the router change in the parent component -> > notifications are too late to intercept > 2. use the OnActivate implementation in the component -> called AFTER > navigation > > How can I use the opposite of CanDeactivate properly to prevent or allow a > navigation to the component? > > Thanks. > -- You received this message because you are subscribed to the Google Groups "angular-dart" group. To unsubscribe from this group and stop receiving emails from it, send an email to angular-dart+unsubscr...@googlegroups.com. Visit this group at https://groups.google.com/group/angular-dart. To view this discussion on the web visit https://groups.google.com/d/msgid/angular-dart/041f401f-f0fb-43aa-84a4-ea5a5df822b7%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.