Quantcast
Channel: JavaScriptMVC Forum
Viewing all articles
Browse latest Browse all 3491

Re : custom service encapsulation

$
0
0
Yes, findAll, findOne and the rest of the CRUD operations return an AJAX deferred.

But when they resolved on success, they are resolved with the model or model list. 

So when you do:
  1. // Fetch player
    can.when(MyApp.Models.Player.findOne({id: '8'})).done(function(player) {

        // player is a Player model
    });

Does this make sense?

Viewing all articles
Browse latest Browse all 3491

Trending Articles