javascript - Ember CLI Hook/Event Error -


i'm using ember cli 1.13 , i'm attempting create router mixin in addon binds willtransition hook, issue i'm encountering not limited event.

at point mixin looks such:

import ember 'ember';  export default ember.mixin.create({     genericfunction: function(transition) {         console.log('--- generic function ---');     }.on('willtransition') }); 

when attempting run dummy app utilising mixin, following error:

uncaught typeerror: (intermediate value)(intermediate value)(intermediate value).on not function 

when including , using addon in separate application, there no errors , functions expected. there no warnings, errors, else hint towards issues use in full application.

the environment config of dummy app , separate application identical, i've ruled out environment config potential issue.

i'm not sure whether or not broken functionality in ember or whether i'm required take additional steps make dummy app behave you'd expect when using hooks/events.

any appreciated.

thanks!

the alternative (and better) solution keep prototype extensions disabled , use non-prototype variant. way, don't force apps use prototype extensions don't wish to.

import ember 'ember';  const {   mixin,   on } = ember;  export default mixin.create({   genericfunction: on('willtransition', function(transition) {     console.log('--- generic function ---');   }) }); 

Comments

Popular posts from this blog

dns - How To Use Custom Nameserver On Free Cloudflare? -

python - Pygame screen.blit not working -

c# - Web API response xml language -