All we need is an easy explanation of the problem, so here it is.
I am looking for a angular js and asp.net mvc 4 sample application. I found some very good samples with for angular js but not so much with insert , add, delete to a database.
Does anyone have any examples available?
How to solve :
I know you bored from this bug, So we are here to help you! Take a deep breath and look at the explanation of your problem. We have many solutions to this problem, But we recommend you to use the first method because it is tested & true method that will 100% work for you.
There are 2-3 project templates for AngularJS and MVC integration
ASP.Net MVC 4 template for AngularJS SPA
http://visualstudiogallery.msdn.microsoft.com/cc6c9c5f-2846-4822-899f-a6c295cd4f2b (Created by me 🙂
Breeze AngularJS template
Here is another tutorial on how to integrate Angular.js and ASP.NET MVC5 (http://xombe.com/2014/02/17/combine-angular-js-with-asp-net-mvc/). The project files don’t have INSERT/ADD/DELETE to a DB, but it demonstrates the core concept of passing a model to Angular.js, updating the model from a Controller, and having Angular.js update the view.
Note: I didn’t know about Breeze.js. I’m going to check that out next 🙂 Looks like it could be a great fit.
Angular is a client side technology so doesn’t have direct access to database but using of a WebAPI or other REST services including cloud databases etc. Also ASP.NET MVC is not a good choice for Angular – Angular uses own routing and templating system so Web Pages is more applicable. John Papa has posted series of guidelines on his web site. Also take a look at TodoMVC project. It’s not exactly guide you are looking for but a good point to start.
What you need is Web API tutorial.
Search tutorials for Web API by REST standard, using Entity Framework. After the tutorial you will be able to create your own integration very easily.
Note: Use and implement method 1 because this method fully tested our system.
Thank you 🙂