lundi 11 juillet 2016

Access private functions in imported module in JS?

I have Ember component that has some functions defined e.g.:

export default Ember.Component.extend({

  _someFunction: function(){}

});

Now if I import this component in some other component:

import FirstComponent from 'somePath...';

Can I and how call _someFunction from FirstComponent? I tried this FirstComponent._someFunction(), but I get errors (is not a function).

I can define this function outside the Ember component and export this function alone but is there some other way?




Aucun commentaire:

Enregistrer un commentaire