Skip to content

Enable user-defined blueprints/templates #556

@thorstenschaefer

Description

@thorstenschaefer

Currently Angular2 CLI provides a fixed set of blueprints to generate. A reoccurring pattern I have seen while using CLI is that I create a service using "ng g service MyService", get the stub which is pretty empty, and then perform similar modifications every time.

For instance, if we create services for REST CRUD operations, they follow a certain pattern:

  • we have a constant for the URL
  • we need to import Observable and Http
  • we have methods like gets, delete, create, etc.

Is there something like a plugin-model/extension point where I can provide my own blueprints to generate and register them to CLI, so I could perform the command "ng g crud-service MyCrudService" in the example above?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions