WEB DEVELOPER SITE
PYTHONJAVAPHP7
 

Angular 4 Setup


Angular 4 is faster than angular 2.


Angular4 uses TypeScript 2.2 version If you are ready To install Angular 4, the Angular team came up with Angular CLI which eases the installation. we must follow to run through a few commands to install Angular 4
if you want install Angular CLI. Go to this site https://cli.angular.io angular_cli First checked before install cli angular make sure nodejs and npm installed with the latest version. node_img To get start Nodejs User can who already install you can check the version of node in the command line using the command, node –v, as shown below − command_prompt_shows_v6.11.0.jpg Then type command npm –v in the terminal npm-v-3.10.10.jpg You will see following commands

npm install -g @angular/cli //command to install angular 4

ng new Angular 4-app // name of the project

cd my-dream-app

ng serve

then you run the Angular CLI command.
npm-v-3.10.10.jpg
The installation process will start and will take a few minutes to complete. angular_cli_installation_step2.jpg angular_cli_installation_step3.jpg
We have also used -g to install Angular CLI globally Type ng -v angular_cli_installation_step4.jpg


To create a project in Angular 4, we will use the following command − angular_cli_installation_step5.jpg
We will use Visual Studio Code IDE for working with Angular 4; you can use any IDE, i.e., Atom, WebStorm, etc.
To download Visual Studio Code, go to https://code.visualstudio.com/ and click Download for Windows. visual_studio_code.jpg
after install look like this
angular_cli_editor.jpg
We have not started any project in it. Let us now take the project we have created using angular-cli.
angular4_app_project.jpg
We will consider the Angular 4-app project. Let us open the Angular 4-app and see how the folder structure looks like.
folder_structure.jpg
type command ng serve
ng_serve_command.jpg ng_serve_command_starts_server.jpg server_starts_on_port_4200 Once you run http://localhost:4200/ on browser You can change the port if you wish using the following command −
ng serve --host 0.0.0.0 –port 4205