mardi 14 mars 2017

Why the mixin inside the route is undefined?

Mixin,

import Ember from 'ember';

export default Ember.Mixin.create({
  hello: false
});

Route,

import Ember from 'ember';
import Foo from 'sample-app/mixins/foo'; // sample-app is the modulePrefix

export default Ember.Route.extend(Foo, {
  model() {
    console.log(hello);
  }
});

Console return an error,

Error while processing route: index hello is not defined ReferenceError: hello is not defined

Why is the mixin inside the route undefined?

When I try to log out the mixin Foo I have to following return which is wired,

Mixin {properties: undefined, mixins: Array(1), ownerConstructor: undefined, _without: undefined, __ember1489502200867: "ember325"…}




Aucun commentaire:

Enregistrer un commentaire