Creating CRUD Application with ASP.NET MVC 5, AngularJS, BootStrap 3, and HTML5 - Part 4

Part 4 : Communicating with ASP.NET MVC

In order for AngularJS to get data from any backend server. It needs to use the http service.







Let's us start by creating the ContactDataService:
  1. Create ContactDataService
    Under the App folder, create DataService folder. Create contactDataService.js. This is where we will communicate with back end. We will be needing 2 dependencies, the '$http' that will handle the XHR communication and the '$q' that handles Asynchronous processing.

  2. Update contactController.js to pull data from the contactDataService
    If you remember previously, we've just assign values to $scope.contacts just to have data. Get rid of that and change it with the code snippet below.
  3. Include the contactDataService.js in the ~/bundles/angularApp.
  4. Press Ctrl + F5 and see the output. Right now we don't have any data yet so next we are going to create the Add, Update and Delete functions.

Part 5 – The Add, Update, and Delete modules

6 comments

Hi from 2 days iam understanding the code but couldnot found where the data is stored in database or any where please help me out of this

Reply

Hi Kumar! Thank you. It is located at the App_Data folder of the same solution. The App_Data folder is hidden on Visual Studio IDE but you can toggle the Show All Files icon at the top of Solution Explorer window. Or you can directly to your directory structure of this solution and browse it.

Reply
Mang Badong mod

What will be the changes in the code if the crud is being implemented in a live server..please help

Reply


I have read your blog its very attractive and impressive. I like it your blog.

Angularjs Online Training Angularjs Training Angularjs Training Angularjs Training in Chennai Angularjs Training in Chennai Angularjs Course Angularjs Course Angular 2 Training in Chennai

Reply

Thanks for sharing,i learnt new things which made me to improve my knowledge.IT employees say that there is no coding experience required to become Data Scientist.If you are the one with no coding background, would suggest you to take Best Data Science Certification Course in Bangalore

Reply