In order for AngularJS to get data from any backend server. It needs to use the http service.
- 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.
- 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.
- Include the contactDataService.js in the ~/bundles/angularApp.
- 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
ReplyHi 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.
ReplyWhat will be the changes in the code if the crud is being implemented in a live server..please help
ReplyGreat Article
ReplyMVC 5 Training
ReplyI 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
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