These are the basic steps involved in creating a new project in Angular 2.
Step 1 Initial setup
Install Node
Install TypeScript
Run the node command npm install -g typescript
Step 2 Create a new project
Here are 2 options from many for creating the new project
If using ASP.NET
- If you are using ASP.NET then there are SPA templates that can be used. See https://blogs.msdn.microsoft.com/webdev/2017/02/14/building-single-page-applications-on-asp-net-core-with-javascriptservices/
- Install templates with command dotnet new –install Microsoft.AspNetCore.SpaTemplates::*
- Created new application
- Create empty folder and run node command dotnet new angular
If using Angular CLI
- Install Angular CLI – starter project from scratch npm install -g @angular/cli
- Be sure to be in the project’s parent folder
- Run command ng new ApplicationName
- >This will create a new folder with the name and it will install all the dependencies
- https://scotch.io/tutorials/use-the-angular-cli-for-faster-angular-2-projects
- https://cli.angular.io/
Step 3 Install dependencies
npm install
Step 4 Build
ng Build
Step 5 Run
Run this command: npm start – same as npm run prod, ng serve, ng serve –e dev
Stop is ctrl-c