Read full article on the Infragistics blog

These days, it seems like everyone is talking about AngularJS and ASP.NET MVC. So in this post we will learn how to combine the best of both worlds and use the goodness of AngularJS in ASP.NET MVC by demonstrating how to use AngularJS in an ASP.NET MVC application. Later in the post, we will see how to access data using the Entity Framework database as a first approach, then we’ll explore how to access the data in AngularJS and then pass to the view using the controller. In short, this post will touch upon:

  • adding an AngularJS library in ASP.NET MVC;
  • · reference of AngularJS, bundling and minification;
  • · fetching data using the Entity Framework database;
  • · returning JSON data from an ASP.NET controller;
  • · consuming JSON data in an AngularJS service;
  • · using AngularJS service in AngularJS controller to pass data to the view; and
  • · rendering data on an AngularJS View

To start, let’s create ASP.NET MVC application and right click on the MVC project. From the context menu, click on Manage Nuget Package. Search for the AngularJS package and install into the project.

Read full article on the Infragistics blog

Advertisements

2 thoughts on “How to use AngularJS in ASP.NET MVC and Entity Framework

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s