Action handlers implemented directly on controllers are deprecated -how to correct this?

前端 未结 2 848
忘掉有多难
忘掉有多难 2021-02-12 20:32

I just upgraded from ember.js RC7 to RC8 and found that a simple template (shown below) would throw a deprecated warning

\"Action handlers implemented di

2条回答
  •  谎友^
    谎友^ (楼主)
    2021-02-12 20:57

    You should define your actions inside the actions hash in the controllers, views and routes to favour consistency.

    Refer this https://github.com/emberjs/ember.js/pull/3091

    Demo Fiddle

    App.ApplicationController = Em.ObjectController.extend({
      actions : {
       // your actions here
      }       
    });
    

提交回复
热议问题