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
An alternative is ng generate component users --standalone --routes=crud, which generates components and route mappings for each CRUD component. ng generate component users --standalone --routes=cr would only generates Create and Read components and mappings.
Describe alternatives you've considered
yasnippets with emacs, but ng incorporating this functionality would make life easier.
The text was updated successfully, but these errors were encountered:
alan-agius4
changed the title
Feature: "ng generate component" needs a flag to generate routes for standalone components.
Feature: "ng generate component" needs a flag to generate routes for standalone components
Mar 5, 2024
This is actually something that @AndrewKushnir was looking at sometime ago. We still had some pending design decisions, which required broader discussions with the rest of team.
Command
generate
Description
Running
ng generate component users --standalone
generatesusers/users.component.{css,html,spec.ts,ts}
files.For imported or lazy-loaded routes, we can create a
users/users.routes.ts
that looks like this:...and import it with
loadChildren
inapp.routes.ts
, butng
could simplify the process.Describe the solution you'd like
ng generate component users --standalone --routes
could scaffold theusers/users.routes.ts
file for us, letting us just fill it in as we go.An alternative is
ng generate component users --standalone --routes=crud
, which generates components and route mappings for each CRUD component.ng generate component users --standalone --routes=cr
would only generates Create and Read components and mappings.Describe alternatives you've considered
yasnippets with emacs, but
ng
incorporating this functionality would make life easier.The text was updated successfully, but these errors were encountered: