我是主干.js 的初学者当我用数据创建模型时,我有错误。
首先声明模型如下;
var verifiedBookPriceSolutionApp = {
Models :{},
Collections : {},
Views :{},
Templates :{}
}
///BackBone model setting;
verifiedBookPriceSolutionApp.Models.Journey = new Backbone.Model.extend({
initialize: function(){}
});
然后我创建一个模型如下,
var journey = {"key": "0T", "carrier": "PS", "carrierName": "Ukraine International Airlines", "flight_number": "102", "origin": "AMS", "destination": "KBP", "departure_time": "2013-08-18T13:10:00.000+02:00", "arrival_time": "2013-08-18T16:55:00.000+03:00"}
var JourneyModel = new verifiedBookPriceSolutionApp.Models.Journey(journey);
在这一行中,我有类似“Uncaught TypeError: Object [object Object] has no method 'apply'”之类的错误
我找不到解决方案为什么会出现这样的错误。
问候 ,