- Angular 6 or <
ng -v
- Angular 7
ng version
- Installed globally in your system with "-g"
npm install -g @angular/cli@latest
-
If you need Update
npm install @angular/cli@latest
-
You can verify if you have the 7 version
ng version
-
more info: https://www.techiediaries.com/updating-angular-cli-projects/
-
Create your project
ng new basicAngular
-
Start service
ng serve
-
Navigate to
http://localhost:4200/
We need to create 3 components
ng generate component menu
ng generate component footer
ng generate component form-users
- You can save time using these styles, just clone the branch
import { ReactiveFormsModule } from '@angular/forms';
- Now you can add logic to the form
-
Generate a new service
ng generate service user
-
Add the import in app.model
-
import { UserService } from './services/user/user.service';
-
Add as providers
- If you have this error
node_modules/rxjs/internal/types.d.ts(81,44): error TS1005: ';' expected error after installation of Angular 6
- Step 1 : Go to package.json and modify "rxjs": "^6.0.0" to "rxjs": "6.0.0"
- Step 2
Run npm update
in your project. - Step 3 :
npm cache verify
- Start service.
ng serve
Run ng generate component component-name
to generate a new component. You can also use ng generate directive|pipe|service|class|guard|interface|enum|module
.
Run ng build
to build the project. The build artifacts will be stored in the dist/
directory. Use the --prod
flag for a production build.
Run ng test
to execute the unit tests via Karma.
Run ng e2e
to execute the end-to-end tests via Protractor.
https://docs.google.com/presentation/d/1fGUlJfMMlXA2veZ6pb3nimdOX5CCIejJx4NR9Ei8kDg/edit?usp=sharing