Setup ASP.NET MVC 4 or 5 project with Angular 2

Nirav Kamani

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?

Dima Kuzmich

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.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

Setup ASP.NET MVC 4 or 5 project with Angular 2

From Dev

Angular2, ASP.NET 5 project setup. "Type expected" error on di.d.ts

From Dev

Host multiple Angular 2 applications in an ASP.NET MVC project

From Dev

how to install angular2 in asp.net 4 project

From Dev

Angular 2 and Asp.Net 5 mvc 6 - authentication practices

From Dev

Angular 2 and Asp.Net 5 mvc 6 - authentication practices

From Dev

How to setup a TeamCity build for a ASP.NET 5 project

From Dev

Does Angular routing template url support *.cshtml files in ASP.Net MVC 5 Project?

From Dev

Reference and use Angular 5+ components within Asp.net MVC 3 project

From Dev

Integration of angular 4 using angular cli and ASP.Net MVC5

From Dev

Return List in Asp Mvc 5 With Angular 2

From Dev

ASP.Net MVC Angular 2 Final

From Dev

ASP.Net MVC Angular 2 Final

From Dev

ASP.NET Core 2 Angular 5 project template doesn't publish

From Dev

Is it possible to compile a ASP.NET MVC 5 project with a mac

From Dev

Event and error logging in Asp.net MVC 5 project

From Dev

project.json in ASP.NET 5 and MVC6

From Dev

Assign Users to Project List In Asp.net Mvc 5 Application

From Dev

ASP.NET MVC5 access folder outside project

From Dev

Running a ASP.NET MVC 5 project locally

From Dev

Designing more complex database for ASP.NET MVC 5 project

From Dev

ASP.NET MVC5 access folder outside project

From Dev

What happens my asp.net mvc Project is using mvc 5 and mvc 5 is not installed on the server

From Dev

ASP.NET 5 MVC6 Angular 2 (Beta 0) - duplicate promise

From Dev

Adding classes to an ASP.NET MVC4 project

From Dev

Update my ASP.NET MVC4 project templates?

From Dev

ASP.Net MVC 4 Project Folder Architeture

From Dev

Migrating ASP.NET MVC 5 project to ASP.NET 5

From Dev

Can the new ASP.NET 5 (ASP.NET MVC 6) project type target regular .NET?

Related Related

  1. 1

    Setup ASP.NET MVC 4 or 5 project with Angular 2

  2. 2

    Angular2, ASP.NET 5 project setup. "Type expected" error on di.d.ts

  3. 3

    Host multiple Angular 2 applications in an ASP.NET MVC project

  4. 4

    how to install angular2 in asp.net 4 project

  5. 5

    Angular 2 and Asp.Net 5 mvc 6 - authentication practices

  6. 6

    Angular 2 and Asp.Net 5 mvc 6 - authentication practices

  7. 7

    How to setup a TeamCity build for a ASP.NET 5 project

  8. 8

    Does Angular routing template url support *.cshtml files in ASP.Net MVC 5 Project?

  9. 9

    Reference and use Angular 5+ components within Asp.net MVC 3 project

  10. 10

    Integration of angular 4 using angular cli and ASP.Net MVC5

  11. 11

    Return List in Asp Mvc 5 With Angular 2

  12. 12

    ASP.Net MVC Angular 2 Final

  13. 13

    ASP.Net MVC Angular 2 Final

  14. 14

    ASP.NET Core 2 Angular 5 project template doesn't publish

  15. 15

    Is it possible to compile a ASP.NET MVC 5 project with a mac

  16. 16

    Event and error logging in Asp.net MVC 5 project

  17. 17

    project.json in ASP.NET 5 and MVC6

  18. 18

    Assign Users to Project List In Asp.net Mvc 5 Application

  19. 19

    ASP.NET MVC5 access folder outside project

  20. 20

    Running a ASP.NET MVC 5 project locally

  21. 21

    Designing more complex database for ASP.NET MVC 5 project

  22. 22

    ASP.NET MVC5 access folder outside project

  23. 23

    What happens my asp.net mvc Project is using mvc 5 and mvc 5 is not installed on the server

  24. 24

    ASP.NET 5 MVC6 Angular 2 (Beta 0) - duplicate promise

  25. 25

    Adding classes to an ASP.NET MVC4 project

  26. 26

    Update my ASP.NET MVC4 project templates?

  27. 27

    ASP.Net MVC 4 Project Folder Architeture

  28. 28

    Migrating ASP.NET MVC 5 project to ASP.NET 5

  29. 29

    Can the new ASP.NET 5 (ASP.NET MVC 6) project type target regular .NET?

HotTag

Archive