lundi 11 mai 2015

ember-data - rerference class in template

I am writing an ember-cli addon and I want to allow the user of the component generated by the addon to use an ember-data class as a source.

For example if I have:

var Employee = DS.Model.extend({
  // attrs
});

export default Employee;

How can I then reference this in a template like this;

{{x-autosuggest source=Employee destination=chosenEmployees searchPath="fullName" minChars=0}}

The above will be undefined.

In the bad old day of globals, I could have used App.Employee:

{{x-autosuggest source=App.Employee destination=chosenEmployees searchPath="fullName" minChars=0}}

How can I reference the class in the template when using es6 modules?




Aucun commentaire:

Enregistrer un commentaire