Drift Angular
Search…
Create a Page
Create New Page Component
To add new page in your app, You have to create a new Page Component.
To create a Angular component run the following command in the command prompt on Windows PC or terminal on Mac.
1
$ ng generate component {component path}
2
3
// or you can use the shorter cammand given below
4
5
$ ng g c {component path}
Copied!
Above cammand will create a component on given path. It will create four files.
For example we create a component 'home' then following files will be generated:
  1. 1.
    home.component.html
  2. 2.
    home.component.scss
  3. 3.
    home.component.spec.ts
  4. 4.
    home.component.ts
We can skip spec file add 3. home.component.spec.ts file using --skipTests=true
1
$ ng generate component --skipTests=true home
Copied!
For more angular command click here.
Last modified 1yr ago
Copy link