1

I really like the promise of Ember Data, and am wondering if there is an idiomatic way to accomplish the same thing in AngularJS. It seems like there isn't, that you have to manage your models manually as opposed to something like this, from http://emberjs.com/guides/models/ .

App.Order = DS.Model.extend({
  lineItems: DS.hasMany('lineItem')
});

App.LineItem = DS.Model.extend({
  order: DS.belongsTo('order')
});

I read this, but it doesn't seem to get at exactly what I'm trying to figure out.

1
  • 1
    Consider checking out breeze.js as well - it a little more work than ember-data to set up but provides more functionality. Commented Feb 26, 2014 at 18:16

1 Answer 1

1

The model is up to you but there are some tools to help with that:

You have your own REST API.

https://github.com/mgonto/restangular

Websocket based database.

https://www.firebase.com/quickstart/angularjs.html

Personally I use a simple generic $http wrapper service to make simple api calls. Especially for when my requests aren't REST for whatever reason.

Other than this I haven't found I needed models when I let my API do most of the work. I speak from building a massively scalable application for business.

Sign up to request clarification or add additional context in comments.

3 Comments

And then can't you nest routes so that AngularJS can intelligently handle parent-child relationships? Isn't that built into AngularJS?
@AliNabavi That's what I'd use Restangular for. Angular's focus is just be a good framework that is easily extendable on a good architecture.
Ah, okay. Interesting. I will try that out.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.