GhostTrain-Backbone
GhostTrain plugin to mock routes for Backbone models.
Usage
var gt = ; var users = '1': name: 'Ozzie Isaacs' skills: 'Planet Riding' gt; var User = BackboneModel;
In action:
var user = id: 1 ;user;
API
GhostTrainBackbone(gt, [$])
Takes a GhostTrain
instance and an optional reference to the jQuery root. Returns an object
containing only a sync
property containing a function that mocks Backbone.sync
for
Backbone models and collections. Use the return object to mixin your models and collections.
If $
is provided, Backbone methods that returned the JQXHR
object returned from the $.ajax
call will now return a $.Deferred
object.