How to use ANGULARJS in ASP. NET MVC and EF

Source: Internet
Author: User

(This article also published in my public number "dotnet daily Essence article", Welcome to the right QR code to pay attention to. )

Angularjs as an increasingly popular front-end framework, when developing Web applications using ASP. NET MVC and the Entity Framework, it makes it easier to develop your front-end interface with proper use. Today's recommended article is about how to incorporate ANGULARJS into ASP. NET MVC development.

Although the previously developed SaaS system is based on ASP. NET MVC, Entity Framework, the front end is supplemented with ANGULARJS. But it's been a long time. Summing up this experience to share with you, just the article recommended today is about how to integrate Angularjs into the Web application development of ASP. In fact, the steps are simple:

    1. Add AngularJS to ASP. NET MVC Web project via NuGet (I usually use the author's package for the AngularJS team)
    2. Reference the Angularjs JS file in the view or layout file, or you can add it to the bundles
    3. Get data through the Entity Framework
    4. Returning JSON data in the controller of the ASP. NET Mvc/web API
    5. Consume the JSON data returned by these services in the ANGULARJS service
    6. Call the Angularjs service in the ANGULARJS controller to pass the data to the view
    7. Rendering data in the Angularjs view

Dhananjay KUMAR This article is basically to follow this step of a complete introductory exercise, through the "read the original" to carefully read the text, mapping and code, to get started is not difficult.

Of course, in practice there are some skills, but also need to find a way to suit their own situation. For example, we did not make the entire Web application a single page application based on ANGULARJS, but simply optimized the front-end code with ANGULARJS's binding, MVC model, on pages that require highly interactive application,spa. In particular, Ng-app is generally based on an ASP. NET MVC view, and these views take full advantage of the features of the ASP itself (such as layout to unify layouts, use of the Partialview combination interface, etc.). We will be free to analyze our experience in detail later.

Original address: http://www.infragistics.com/community/blogs/dhananjay_kumar/archive/2015/05/13/ How-to-use-angularjs-in-asp-net-mvc-and-entity-framework-4.aspx

How to use ANGULARJS in ASP. NET MVC and EF

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.