-
Notifications
You must be signed in to change notification settings - Fork 12k
fix(@schematics/angular): default interface for guard #15313
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for this, see above.
Also, this commit should probably be a fix
What about adding |
I think the combination of all the suggested above. Will fix this schematic for both interactive and not. As at the moment when not interactive the valid implementation is too loose. |
cd20e84
to
9b3d508
Compare
@alan-agius4 I amended the commit with your suggestions and @clydin 's 👍 That should handle the interactive and non interactive cases. |
9b3d508
to
c3d15b6
Compare
Currently, if the user hits `<Enter>` before selecting an interface to implement, the CLI generates a broken guard that implements no interface. With this commit, the CLI forces a choice in interactive mode and generates a `CanActivate` guard by default.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks for this.
c3d15b6
to
f48286e
Compare
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
Currently, if the user hits
<Enter>
before selecting an interface to implement, the CLI will generate a broken guard that implements no interface. With this commit, the CLI generates aCanActivate
guard by default.