Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to use ASP .NET Web API methods in a Ember.js application

I'm using this Emberjs template http://www.asp.net/single-page-application/overview/templates/emberjs-template to make an ember application inside asp .net. I have developed some basic web api's using asp.net web api, but how would I call these POST, GET, etc methods from the ember application? i.e. How would I connect my ember controller, models and views to this asp .net back-end?

like image 504
Akk Avatar asked Oct 21 '22 14:10

Akk


2 Answers

I blogged this issue over here http://www.emadibrahim.com/2014/04/09/emberjs-and-asp-net-web-api-and-json-serialization/ this works for GETs but working on a custom model binder to make it work for POSTs and PUTs - I will update my answer when done.

like image 64
Emad Avatar answered Oct 24 '22 00:10

Emad


Have a look at the Ember.js getting started guide. After you have your application set up, you could use Ember Data to communicate with your back end. If you follow conventions it's as easy as swapping out your adapter for DS.RESTAdapter

like image 33
chopper Avatar answered Oct 23 '22 23:10

chopper