duizendnegen / ember-cli-lazy-load

Support lazily loading your Ember app via splitting it up into Bundles
MIT License
42 stars 8 forks source link

Some problem with lazy loaded controllers #8

Open amakuningit opened 8 years ago

amakuningit commented 8 years ago

In 'dummy' app, added into controllers/about.js: actions : { testAction : function () { console.log('test'); } }, someProp : true }); templates/about.hbs: <h3 {{action 'testAction' on 'click'}}>About page </h3> Got in console: ember.debug.js:16628 Uncaught Error: Nothing handled the action 'testAction'

duizendnegen commented 8 years ago

Thanks, will fix soon, also welcoming a PR

Cryrivers commented 8 years ago

is it possibly because lazy-loaded modules are not registered in the registry?

duizendnegen commented 8 years ago

This is possible - the happy path is surely to switch away from this plugin and use ember-engines, their beta version is more stable than this addon & also supports lazy loading.

Cryrivers commented 8 years ago

@duizendnegen yeah, but only services and routes can be shared in ember-engines, i believe people will still choose ember-cli-lazy-load to build lazy bundles in most cases.

duizendnegen commented 8 years ago

I'd happily accept a PR which fixes entering lady-loaded modules in the registry. I did not spend any effort on making sure that happens so it's very much possible that the registry entry doesn't happen.

If there is an open or closed issue on ember-engines highlighting the decision to not support anything but routes and services, I'd be very happy if you could link it in here!