ember.js - Using Instance Initializers with Ember 1.12.0 and the Ember CLI -


after updating app ember 1.12.0, notice lots of warnings this:

lookup called on registry. initializer api no longer receives container, , should use instanceinitializer objects container. see http://emberjs.com/guides/deprecations#toc_deprecate-access-to-instances-in-initializers more details.

this seems caused using container.lookup initializer, fine in older versions of ember.

from blog post ember 1.12.0, seems in global-based ember application, difference between making initializer , instance initializer using

app.initializer({     ... }); 

vs

app.instanceinitializer({     ... }); 

however, doesn't seem describe how use instance initializers ember cli. know how use them?

edit: turns out browser plugin of things blocking information needed on original blog post. i'll leave here in case it's useful anyone, in cli regular initializers go inside

app/initializers/__my__initializer.js 

while instance initializers defined like

app/instance-initializers/__my__initializer.js 

edit 2: if coming here because they're experiencing same problem, this issue on ember.js repo references problem , includes link jsfiddle demonstrating problem.

turns out browser plugin of things blocking information needed on original blog post. i'll leave here in case it's useful anyone, in cli regular initializers go inside

app/initializers/__my__initializer.js 

while instance initializers defined like

app/instance-initializers/__my__initializer.js 

Comments

Popular posts from this blog

Email notification in google apps script -

c++ - Difference between pre and post decrement in recursive function argument -

javascript - IE11 incompatibility with jQuery's 'readonly'? -