generate module with routing in angular
ng g m [ModuleName] --routing
generate module with routing in angular
ng g m [ModuleName] --routing
angular cli generate new module
ng generate module module-name
ng new module w route
// Use this command to create a lazy-loaded feature module with routing, along with its stub component.
ng generate module <MODULE_NAME> --route <ROUTE> --module app.module
create class angular
// to create a model class, we first need to create a new file
//f.e person.ts
export class Person {
constructor(
public name: string,
public lastName: string,
public age:number
) {}
}
//now that we have the model class we can create arrays that contain Person class elements
.
.
public people: Person[];
constructor(){
this.people = [
new Person ('Carla','Smith', 20 ),
new Person ('Carlos','Smith', 25 ),
new Person ('Andrea','Johnson', 23 ),
];
}
ng g c in module
ng generate module component-name --module=any-parent-module --route=route-path
angular cli skip-tests
The name of the TypeScript configuration file for tests. Default: ... --skipTests=true|false. When true, does not create "spec.ts" test files for the app. Default: false
While generating component using cmd
>ng g c component-name --skipTests
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us