Creating First Angular Application
Step 1(Node.Js):
- Download and Install the latest version of Node.Js(Download Node.Js)
Step 2(Install AngularCLI):
- Open Command prompt and give npm install -g @angular/cli
Note:
- Ignore the warning in case if you get it on installation
Step 3(Checking AngularCLI Installed or Not):
- Open Command prompt and give ng v
Outcome:
Note:
- As similar to above outcome, You can see in your machine. If not valid the Step 1 & Step 2
- This may differs to other OS.(I installed for Windows)
Step 3(Installing IDE - I prefer VSCode):
- Download and Install Visual Studio Code (Download VSCode)
Step 4(Creating Angular - Thru VSCode and CLI ):
- Open VSCode on your machine
- Go to View -> Integrated Terminal
- Now you can see the terminal window bottom of the VSCode.
- Inside Command Prompt , Navigate to the directory which you wanted to create angular App(Example : C:\AngularProject)
- Run the Command ng new my-first-angular-app
- Wait till it completes
Step 5(Opening project in VSCode):
- From VSCode, File -> OpenFolder
- Select your project name folder
Step 6(Running project in VSCode):
- Open Integrated terminal from VSCode(Make sure,you have selected project name directory)
- Run ng serve
- By default ,It generates http://localhost:4200/ URL by accessing that you can see the angular in browser.
Outcome:
Step 7(Editing Home Page Content):
- Open app.component.html from your project.
- Remove all existing html and add your own html code.(Example: <h1> Welcome to Angular World!! </h1>)
- Just save your changes and see http://localhost:4200/ (Make sure , Ng Serve Already running on your project)
Outcome :
Conclusion:
- It is super easy to create angular application through Angular CLI.
- Refer all my angular post to make yourself master in angular.
No comments:
Post a Comment