ngx-schematics-collection

0.0.5 • Public • Published

Schematics Collection

npm version

Master: Build Status

Develop: Build Status

Some useful schematics.

Install

npm install --save-dev ngx-schematics-collection

Usage

Generate form control

ng generate ngx-schematics-collection:form-control component-name

The command above will generate a component with NG_VALUE_ACCESSOR related code.

The other parameters are same as generate component.

Generate validator directive

Using command below to generate a validator directive:

ng g ngx-schematics-collection:validator my-validator

or generate a async validator

ng g ngx-schematics-collection:validator my-validator --isAsync

The other parameters are same as generate directive.

Generate route guards

You can create different types of route guard:

  • CanActivate to mediate navigation to a route.
  • CanActivateChild to mediate navigation to a child route.
  • CanDeactivate to mediate navigation away from the current route.
  • Resolve to perform route data retrieval before route activation.
  • CanLoad to mediate navigation to a feature module loaded asynchronously.

Just choose a type of route guard, then use it to --type parameter, for example: create a 'CanActivate' route guard:

ng g ngx-schematics-collection:route-guard route-guard-name --type=CanActivate

The other parameters are same as generate service.

Package Sidebar

Install

npm i ngx-schematics-collection

Weekly Downloads

1

Version

0.0.5

License

MIT

Unpacked Size

301 kB

Total Files

74

Last publish

Collaborators

  • wellwind