Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/ember.js/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 使用mixin和参数创建Ember.Application.create_Javascript_Ember.js - Fatal编程技术网

Javascript 使用mixin和参数创建Ember.Application.create

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 } 理想情况

我正在使用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({
  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之后。对于像我这样来自未来的人,请注意: