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

sucess and error callback functions are passed as undefined to findOne findAll

$
0
0
Provider - model
"findOne" : function (nodata, success, error) {
return $.ajax({
url : "someurl",
type : "GET",
dataType : "json",
success: sucess // this is passed as undefined - is this because the deferred object is used to convert json to model object internally?
});
}

I am doing 
Provider.findOne({"id":1}, function(provider){
      // success
});

In canjs do I always need to use deferred like 

Provider.findOne({"id":1}).then(function(provider){
      // success
});


Viewing all articles
Browse latest Browse all 3491

Trending Articles