Skip to content Skip to sidebar Skip to footer

Backbone-style Models In Angularjs?

I apologize if this question has already been answered elsewhere, but I couldn't find a full, obvious (to me, at least) solution. I have experience with the idea of a Model in back

Solution 1:

In Angular models are just a POJOs (plain old javascript objects).

Services are something different, but you'll usually fetch the models with services. It is a good practice to have more services, so you can reuse them throughout your application. Also a big plus for services is, that they can be unit tested. And like everything else in software engineering, it's always better to split your application into little modules which are easier to maintain than a big chucks of code.

You don't need to just mimic your models as service. You can later add some functions to them and keep your domain logic inside those services.

I'm not an Angular specialist, but I hope this can help.

Post a Comment for "Backbone-style Models In Angularjs?"