Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Ember.Application.create with mixin and parameters

I am creating an ember application using the Ember.Facebook mixin (https://github.com/luan/ember-facebook) which requires the Ember app to be defined as:

App = Ember.Application.create(Em.Facebook);

However, I need to define some parameters for my app, such as

{
rootElement: 'survey',
autoinit: false,
nextStep: 1,
appId: 113411778806173
}

Ideally these are added to the app using

App = Ember.Application.create({
  rootElement: 'survey',
  autoinit: false,
  nextStep: 1,
  appId: 113411778806173
});

so that they are there on runtime, however it is necessary to use App.setProperties() with the ember.facebook mixin.

How can I define the mixin and the parameters in the Em.Application.create() call?

like image 400
Reuben Posthuma Avatar asked Dec 12 '22 19:12

Reuben Posthuma


1 Answers

In ember master, use:

App = Ember.Application.createWithMixins(Em.Facebook, {
  rootElement: 'survey',
  autoinit: false,
  nextStep: 1,
  appId: 113411778806173
});

In previous releases of ember, you can use create with the same syntax.

like image 181
Luke Melia Avatar answered Dec 23 '22 08:12

Luke Melia