Saulius
Saulius

Reputation: 2006

Prevent error of missing handler in controller

How can we normally prevent Nothing handled the action error in generic view implementation. Currently I am reopening controller class and adding empty handler but again if I put it directly Ember throws deprecation message Action handlers implemented directly on controllers are deprecated if I add it in action object it is "not working" (probably overridden) and throws error as if it is not in base controller. Any ideas? Thanks.

Upvotes: 0

Views: 42

Answers (1)

GJK
GJK

Reputation: 37369

If you want a somewhat hacky way to do it, you can add the method to the _actions object on the controller. That's where Ember internally keeps all of the actions for an object. Unfortunately, there's no other way to really handle an unused action from a view. This issue suggested a feature that would allow you to, but it hasn't been implemented yet.

Personally, I don't use straight views at all, I only use components. Components allow you to subscribe to particular events (let them bubble up) and ignore the others completely.

Upvotes: 1

Related Questions