You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Usually all of our feature modules are lazy loaded.
So the developer has to run at least two commands to create a new module to get our default file layout.
ng g m Foo -- routing
ng g c Foo --flat
Then the developer has to add a default route to the new modules routing module as well as the lazy loading route definition to the nearest parent module.
As the syntax and relative paths are allways the same, wouldn't it be possible to add some flags to combine those stepts?
maybe like this:
ng g module Foo --routing --component --lazy
or even simpler
ng g feature Foo (--lazy)
Reacted by N8 May, Stanislav Dontsov, Robert, Eliran Eliassy and Ryan Dammrose
This can be prototyped with custom schematics eg: ng generate lazy-feature where lazy-feature will be a new schematic which can start as a part 3rd party collection and when stable enough can be included in main @schematics/angular repo?
I am also interested in creating custom schematics but until something is done about this issue and this PR you would have to include original @schematics/angular in your schematics and delegate calls for everything you are not implementing yourself.
After the feature is merged it will be possible just to add your own schematics on top of default ones provided by Angular CLI just by adding your own collection in angular-cli.json.
Activity
tomastrajan commentedon Dec 4, 2017
This can be prototyped with custom schematics eg:
ng generate lazy-featurewhere lazy-feature will be a new schematic which can start as a part 3rd party collection and when stable enough can be included in main@schematics/angularrepo?mbeckenbach commentedon Dec 5, 2017
@tomastrajan
Sound very interesting. Is there any link to a guide on creating custom shcematics?
tomastrajan commentedon Dec 5, 2017
@mbeckenbach check out this talk from Angular Connect 😉
I am also interested in creating custom schematics but until something is done about this issue and this PR you would have to include original
@schematics/angularin your schematics and delegate calls for everything you are not implementing yourself.After the feature is merged it will be possible just to add your own schematics on top of default ones provided by Angular CLI just by adding your own collection in
angular-cli.json.Cheers!
Robbie106gti commentedon Nov 16, 2018
They have made it fairly easy to do now, you can just do:
_
_
and add the route to your main router file/const
doggy8088 commentedon Aug 7, 2019
I think this feature has been implemented in v8.1.0.
fdcd1f7
clydin commentedon Aug 7, 2019
Closing as indicated above.
angular-automatic-lock-bot commentedon Sep 9, 2019
This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.
Read more about our automatic conversation locking policy.
This action has been performed automatically by a bot.