Reu*_*uma 4 javascript ember.js
我正在使用Ember.Facebook mixin(https://github.com/luan/ember-facebook)创建一个ember应用程序,它要求将Ember应用程序定义为:
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和参数?
Luk*_*lia 13
在ember master中,使用:
App = Ember.Application.createWithMixins(Em.Facebook, {
  rootElement: 'survey',
  autoinit: false,
  nextStep: 1,
  appId: 113411778806173
});
在以前的ember版本中,您可以使用create相同的语法.