Skip to content

Instantly share code, notes, and snippets.

@jamesmorgan
Last active April 3, 2016 16:29
Show Gist options
  • Save jamesmorgan/7c8017a5e5774ac3f2fe40ea9f4055c2 to your computer and use it in GitHub Desktop.
Save jamesmorgan/7c8017a5e5774ac3f2fe40ea9f4055c2 to your computer and use it in GitHub Desktop.
/**
* This is a special hook because it is called before your component is instantiated.
* Its parameters are (next, previous) which are the components you're routing to and the component
* you've come from (or null if you have no history) respectively.
*/
@CanActivate((next, prev) => {
// No simple way to load data, how to easily inject services or how to provide the result to componenet once loaded.
// Work arounds can be found but are not ideal IMHO.
return true;
})
export class DashboardComponent {
// ...
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment