For creating a new Angular project, some tools are required. Kindly, download and install the below tools.
- Visual Studio (Here, I have to use Visual Studio 2017 community).
- TypeScript
- Node.js
Step 1. Click File >> New >> Project on the Start page or in the File menu.
![Start page]()
Step 2. After creating a new project, select Web, choose ASEP.NET Core Web Application, select your project location, and enter your web application's name. Finally, click OK.
![Web Application]()
Step 3. A new ASP.NET MVC5 Project window will open; there, you have to choose MVC and press OK.
![ASP.NET]()
Step 4. Right-click your project and click Add >> New Item. Either press "Ctrl + E" or in the search box, type ''npm". Select the npm configuration file, enter your file name (package.json), and click "Add".
![New Item]()
Step 5. Right-click your project and click Add->New Item. Either press (ctrl + E) or in the search box, type ''json" and then select "Typescript JSON Configuration File". Enter your file name (tsconfig.json) and click "Add".
![Typescript JSON]()
Step 6. In Solution Explorer, right-click the package.json file. Click "Restore Package" and click "Install all" The node_modules reference file will be added.
![Restore Package]()
![Install all]()
After installing the Restore packages, all node_modules reference files are added to your project. We have no need to click include our project because it is added by default.
Step 7. Similarly, select the "JavaScript File", enter your file name (systemjs.config.js ), and click "Add".
![JavaScript File]()
Step 8. Add Index file. Here, I have no need to add an index.html page but I have to change the index and cshtml page code. Go to Views --> Home --> Index.cshtml file and replace the code.
Step 9. Add more TypeScript files the same way. Here, I have added three *.ts files.
- app.module.ts
- app.component.ts
- main.ts
- app.component.html
![TypeScript files]()
The main.ts file code is shown below.
The app.module.ts file code.
The app.component.ts file code is below.
The app.component.html file code is below.
Finally, I have added all config, reference files, and source code. If you Rebuild or Run (F5) the project, all TS code automatically regenerates as .js file because some browsers do not support the TypeScript files.
![Rebuild or Run]()
After running the project, it automatically adds app.module.js and app.module.js.map file in the Solution Explorer.
![Solution Explorer]()
![Angular4]()
Finally, I have done the Angular4 basic configuration. In the next article, I’ll explain the components and services.