Hello world Application
Start with Hello world Application
Angular 2 can be coded in many ways.- First option is to start from the scratch.But I would not recommend this for beginners because there are so many dependencies need to be added to the project.
- For beginners,I recommend following option to start with Use Quick start at Angular Github.
- Use Angular CLI.
Setting up an Environment.
To begin with, I have used 2nd option for this example as this is a good way to start .Following is the URL for Angular Github.
Go to Project directory ⟹ Open cmd ⟹ Type bellow URL
git clone https://github.com/angular/quickstart Hello
Then clone the github repository to your local system and this will create sample “Hello”Angularjs application.
File structure
Then Open Hello Project in VS Code.Once it opened, we should add other necessary packages which required for angular 2.0. In order to do that, open cmd or Integrated Terminal in VS Code.I have Used Integrated Terminal in VS Code.
Open Hello ⟹ src ⟹ app ⟹ app.component.ts
index.html
Once you finished the changes you can run the application.
Then,to run the application Open cmd or Integrated Terminal and type
npm start
Then, application will launch in the default browser.
This is the end of Hello World example & next article I will discuss about how to use Gulp to build the project.
Comments
Post a Comment