2013-08-18 21 views

回答

0

看一下例子

http://jsfiddle.net/evilcelery/dW2Qu/

var user = new User({ 
    title: 'Mr', 
    name: 'Sterling Archer', 
    email: '[email protected]', 
    birthday: new Date(1978, 6, 12), 
    password: 'dangerzone', 
    notes: [ 
     'Buy new turtleneck', 
     'Call Woodhouse', 
     'Buy booze' 
    ] 
}); 

這些是默認值。

你的情況,你可以使用類似的東西來

var options = new App.Collection.Tags; 
class foo extends Backbone.Model 
    schema: 
    tag: 
    type: 'select' 
    options: options 
for (first in options) break; 
var Foo = new foo({tag:first});