Angular 4: unable to generate new components using Angular CLI
By : L Watters
Date : March 29 2020, 07:55 AM
This might help you I want to use the Angular CLI to generate a new component. , This worked for me. Do a clean uninstall and reinstall:
|
Generate a new class into a specific folder in Angular
By : Forrest VanderBorgh
Date : March 29 2020, 07:55 AM
hop of those help? When I am trying to use ng g class classname and I am in the folder I want my class to be created, it still creates it outside the folder, in the app folder for instance. , For example you have app/components/folder/ The command is : code :
ng g class components/folder/yourClassName
|
Is it possible to generate multiple Angular components using single angular-cli command like ng generate component comp1
By : user1430633
Date : March 29 2020, 07:55 AM
wish help you to fix your issue Well, there is nothing as of now by Angular CLI to create multiple components. But this can be done trivially in any shell. Run this command into your bash shell - code :
for i in comp1 comp2; do ng g c "${i}"; done
|
How do you generate sub-components in Angular 6
By : Srikanth Janardhan
Date : March 29 2020, 07:55 AM
I hope this helps . The components in the link above are child routes of the layout component. The routing is described in layout-routing.module.ts For example code :
{ path: 'charts', loadChildren: './charts/charts.module#ChartsModule' },
<app-header></app-header>
<app-sidebar (collapsedEvent)="receiveCollapsed($event)"></app-sidebar>
<section class="main-container" [ngClass]="{collapsed: collapedSideBar}">
<router-outlet></router-outlet>
</section>
ng g m layout/chart --routing // create chart module inside layout module
ng g c layout/chart // create chart component inside chart module
|
ng generate application to a specific folder (without projects folder)
By : user3293379
Date : March 29 2020, 07:55 AM
To fix this issue In your angular.json, change the property value of newProjectRoot from projects to dashboards. "newProjectRoot": "dashboards",
|