-
Notifications
You must be signed in to change notification settings - Fork 11.9k
Closed
Labels
area: @schematics/angularfeatureIssue that requests a new featureIssue that requests a new featurehelp wanted
Milestone
Description
🚀 Feature request
Request to add option to implement CanDeactivate interface while generating a guard using ng generate
.
Command (mark with an x
)
- [ ] new
- [ ] build
- [ ] serve
- [ ] test
- [ ] e2e
- [x] generate
- [ ] add
- [ ] update
- [ ] lint
- [ ] xi18n
- [ ] run
- [ ] config
- [ ] help
- [ ] version
- [ ] doc
Description
The CLI has a nice selection option and schematics to implement CanActivate, CanActivateChild, CanLoad interfaces while generating a new guard. While I understand that it is not as straightforward as the others, it would be nice to have the option to implement the CanDeactivate interface as well.
Describe the solution you'd like
It would be nice to have a flag to indicate the component for which we want to implement the CanDeactivate interface for while generating it. Generate the guard for the component and update the component to add a generic canDeactivate() method similar to how we auto-update a module when a new component is created under it.
Metadata
Metadata
Assignees
Labels
area: @schematics/angularfeatureIssue that requests a new featureIssue that requests a new featurehelp wanted