Relation=d;
no model, key or relatedModel (function (){a.apply(this,arguments)},
"tasks",
undefined).
   
define([
    'backbone',
    'relationalModel'
], function (Backbone) {
    "use strict";

(to be continue...) (continue)
    var User = Backbone.RelationalModel.extend({

        relations: [{
            type: Backbone.HasMany,
            key: 'tasks',
            relatedModel: 'Task',
            collectionType: 'TaskCollection',
            reverseRelation: {
                key: 'hasUser',
                includeInJSON: 'id'
                // 'relatedModel' is automatically set to 'User'; the 'relationType' to 'HasOne'.
            }
        }]

    });

    return User;
});

Date: 2012-11-06 10:32:05 and last modified: 2012-11-06 10:32:05

Relate tags:

Hot tags: