Skip to content
This repository has been archived by the owner on Dec 8, 2022. It is now read-only.

Add ability to override default route configuration #423

Closed
Blackbaud-PatrickOFriel opened this issue Mar 1, 2017 · 5 comments
Closed
Assignees

Comments

@Blackbaud-PatrickOFriel
Copy link
Contributor

When we generate routes based on the file system we need to allow the consumer to specify overrides for the generated route, such as canActivateRoute and canActivateChild which will be SPA-specific.

From blackbaud/skyux-cli#5

@blackbaud-brandonstirnaman

I'll be taking a stab at this in the next day or so.

@Blackbaud-PaulCrowder
Copy link
Member

Some thoughts on a possible implementation:

  • Just like we detect an index.html in the folder to create the route, we could detect an index-guard.service.ts file.
  • We import this file, extract the class name, and add it to the route's canActivate property when we define the route.

@blackbaud-brandonstirnaman

I feel like index.guard.ts would be a better naming convention but generally agree on that implementation.

@Blackbaud-PaulCrowder
Copy link
Member

That was my initial thought as well, but I noticed in the Angular docs they used the name auth-guard.service.ts. There's no mention of route guard naming conventions in their style guide, though, so I'd be fine with index.guard.ts.

@blackbaud-brandonstirnaman

This is now available in builder 1.0.0-beta.31 for canActivate/canDeactivate.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants