Reputation: 2571
I am upgrading my Emberjs => from 1.10.0 to 1.12.0 Ember-cli => from 0.1.12 to 0.2.5
While i am figuring out most of the deprecations there are few which i am not able to understand. PFB the same
lookupFactory
was called on a Registry. The
initializer
API no longer receives a container, and you should use
an instanceInitializer
to look up objects from the container.
//app/initializer/abc
initialize: function(registry, app) {
app.register('store:main', Store);
// Inject into each route a store property with an instance of store:main
app.inject('route', 'store', 'store:main');
// Inject into each controller a store property with an instance of store:main
app.inject('controller', 'store', 'store:main');
}
//app/initializer/def
initialize: function(registry, app) {
// Register the session object.
app.register('session:main', Session);
// Inject the session object into all controllers.
app.inject('controller', 'session', 'session:main');
}
DEPRECATION: Using the context switching form of {{each}} is
deprecated. Please use the block param form ({{#each bar as
|foo|}}
) instead. See
http://emberjs.com/guides/deprecations/#toc_more-consistent-handlebars-scope
for more details.
I understand here that {{#each foo in bar itemController="abc"}}
should be changed to {{#each bar itemController="abc" as |foo|}}
. But my code is as below and does not have "in"
, meaning using this context!
{{#each paged itemController="class.adm.man.stop-term"}}
How can i change this?
Upvotes: 0
Views: 361
Reputation: 1117
Following your list:
in
part is not deprecated for now, so the simplest solution is to add dummy in
part, for example {{#each page in paged itemController="class.adm.man.stop-term"}}
. But in general I'd recommend to use more complex solution - to create an ItemList
component and refactor it as: {{#each paged as |page|}}
{{item-list model=page}}
{{/each}}
Upvotes: 2