I am learning angular 2 with Typescript.
I am using following resource. QuickStart with Angular 2
Now from there and other examples i found that they telling to create package.json file that lists all dependencies for project.
I think creating this package.json file and listing all dependency packages this kind of structure is followed in .NetCore Project.
In MVC 4 or 5 we have packages.config file which lists although packages that we are going to use.
I am not saying we can not use package.json file when we have package.config file.
But is there any simple way to integrate Angular 2 with typescript in MVC Webapplication project using NUGet Packages and get started?
If not available please let me know how can i setup Angular 2 with type script in ASP.Net MVC 4 or 5?
As you said, in ASP.NET MVC application you have a package.config
file. This file holds the information about NuGet packages you've installed in your app. This file is related to the server-side packages.
package.json
file is related to a front-end part of your app. It also holds list of packages that you've installed in your app. This time npm
packages. It also holds information about your app and more. You can read more about it here.
You can't mix those files and you don't want to. Firstly, those files have different format (XML and JSON). In addition, as I said before, they hold information about different parts of your application. Lastly, and this is my personal opinion, when you create application with rich UI and use Angular2, it'd be better to split the parts of your app into 2 different projects. One of them with Web APIs and the second with the UI part only. With such structure, you will no need for packages.config
in UI project and no need for package.json
in Web API project.
For you last question, you can start with here. You also can take a look on this sample app.
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments