How to fix deprecation in Ember 1.13.3


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 -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|}}

And i got the same deprecation alert.

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

didInsertElement: function() {

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


i have found how to fix this.

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

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