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

custom service encapsulation

$
0
0
The documentation says:
FindOne is used to retrive a model instances from the server.
FindAll is used to retrive a model instances from the server.
etc.

The examples of custom implemented services do not return instances,
Instead they return ajax defered (with raw data from server as result).
Is it bogus documentation, or do i miss something?

  1. $.Model('Contact',{
      findAll : function(params, success, error){
    
        // do the ajax request
        return $.get('/contacts.jsonp',
          params, 
          success,
          'jsonp contact.models');
      }
    },

Viewing all articles
Browse latest Browse all 3491

Trending Articles