Javascript 使用mixin和参数创建Ember.Application.create
我正在使用ember.Facebook mixin创建一个ember应用程序(https://github.com/luan/ember-facebook)这要求将Ember应用程序定义为:Javascript 使用mixin和参数创建Ember.Application.create,javascript,ember.js,Javascript,Ember.js,我正在使用ember.Facebook mixin创建一个ember应用程序(https://github.com/luan/ember-facebook)这要求将Ember应用程序定义为: App = Ember.Application.create(Em.Facebook); 但是,我需要为我的应用程序定义一些参数,例如 { rootElement: 'survey', autoinit: false, nextStep: 1, appId: 113411778806173 } 理想情况
App = Ember.Application.create(Em.Facebook);
但是,我需要为我的应用程序定义一些参数,例如
{
rootElement: 'survey',
autoinit: false,
nextStep: 1,
appId: 113411778806173
}
理想情况下,可以使用
App = Ember.Application.create({
rootElement: 'survey',
autoinit: false,
nextStep: 1,
appId: 113411778806173
});
因此,它们在运行时就存在,但是有必要将App.setProperties()与ember.facebook mixin一起使用
如何在Em.Application.create()调用中定义mixin和参数?在ember master中,使用:
App = Ember.Application.createWithMixins(Em.Facebook, {
rootElement: 'survey',
autoinit: false,
nextStep: 1,
appId: 113411778806173
});
在ember的早期版本中,您可以使用相同语法的
create
。可以指定版本吗?哪一个是以前的版本?推出了哪个版本?createWithMixin
是在1.0.0-3年前首次发布的。我在这里补充说,直到我这么做它才对我起作用:App.set(“appId”,id);就在createWithMixin之后。对于像我这样来自未来的人,请注意: