Base ASP.NET Core project with Angular 2 and TypeScript build-in. You can find more information on my post.
In order to easily recreate this structure, you can follow the commits in this repository. Each commit shows a step to configure the base structure for this kind of project.
- Create your ASP.NET Core project with MVC: 79174d9
- Add Angular 2 dependencies to your package.json: 452a86e
- Add Gulp tasks to copy the Angular 2 dependencies to the wwwroot folder: 1d2a6f1
- Update layout to include Angular 2 dependencies: d276963. Minor path fix by @mikekidder: 2b92f08
- Add TypeScript configuration file: bbd1842
- Add es6-shim's TypeScript definitions: fdbd2f3
- Add app.component.ts file with the sample AppComponent: 0e9567f
- Add boot.ts with the bootstrap of the Angular 2 application: 051a0a2
- Update index page with the logic to initialize the Angular 2 application: 514ce93
To keep this sample simple and include the feedback and code from @BradRem, I added a new branch named routing-sample with the base structure for Angular 2 routing.
I added a new branch named http-sample with the base structure for using the HTTP service in Angular 2 to consume an ASP.NET Core API.
You can find the full solution with Angular 2 configured to use HTTP and Route components in an ASP.NET Core application in Visual Studio in the full-sample branch.