How to fix deprecation in Ember 1.13.3


#1

Hi everyone. I have com-switcher component which active uses controller.

{{com-switcher companies=app.companies websites=app.websites ctrl=controller}}

And on compilation get error: DEPRECATION: Using {{controller}} or any path based on it (‘builder/templates/sidebar.hbs’ @ L3:C63) has been deprecated. [deprecation id: view.keyword.controller] See http://emberjs.com/deprecations/v1.x#toc_view-and-controller -template-keywords for more details.

I have tried to fix like in link example:

{{#com-switcher companies=app.companies websites=app.websites ctrl=controller as |passedData|}}
{{/com-switcher}}

And i got the same deprecation alert.

This component doesn’t have any template. All DOM structure is appended dynamically, like

didInsertElement: function() {
    this.$().append('<div>component</div>');
}

How can i fix this? How can i pass controller in proper way?


#2

i have found how to fix this.

// template
{{com-switcher ctrl=ctrl}}

// controller
ctrl: Ember.computed(function() {
    return this;
})