What is Angular 6.0?
Angular 6.0 is the newly released version of Angular.In this article I'll explain you how to set up a new project with angular 6.0 and visual studio code.
Prerequisites
- Make sure that you have Node.js and NPM installed on your machine, if not, visit the Node.js website to install the latest version.
- Make sure that you have installed Visual Studio Code,if not visit VS code website
If you have installed node.js and npm then you can install angular CLI.Run the following command in the command prompt.
Create a project using angular 6
Open VS Code and navigate to view>>Intergrated Terminal.
This will open a terminal window in VS Code.
Type the following sequence of commands in the terminal window.These commands will create a directory with name "webchat" and then create an angular application with the name "chat" inside the directory.
- mkdir webchat
- cd webchat
- ng new chat
Open package.json file then you can observe we have latest Angular 6.0 packages in our project.
Execution
The name of our angular application is "chat" which is inside "webchat" directory.So,we should navigate this appliction using following commands.
- cd webchat
- cd web
- ng serve
- ng serve --open
After running ng serve command you can see that it is asking to open http://localhost:4200 in your browser.
If you use ng serve --open(or just -o) , it will automatically open your browser on http://localhost:4200/
Now you can do changes and refresh the browser then notice changes.
No comments:
Post a Comment