Install Angular js2 or 4 https://cli.angular.io/
CLI and generated project have dependencies that require Node 6.9.0 or higher, together with NPM 3 or higher.
So firstly we need to install node js: https://nodejs.org/en/download/
- Install the Angular CLI globally.Cmd=> npm install -g @angular/cli
- Create a new projectCmd=> ng new my-app
- Serve the application, Go to the project directory and launch the serverCmd=> cd my-appCmd=> ng serve –open OR Cmd=> ng serve --host 0.0.0.0 --port 4201
Services using CLI in angular 2 or 4.
Use=> localhost://4200
Component=> ng g component my-new-component
Directive=> ng g directive my-new-directive
Pipe=> ng g pipe my-new-pipe
Service=> ng g service my-new-service
Class=> ng g class my-new-class
Guard=> ng g guard my-new-guard
Interface=> ng g interface my-new-interface
Enum=> ng g enum my-new-enum
Module=> ng g module my-module
No comments:
Post a Comment