Quantcast
Channel: Ember.JS - Latest topics
Viewing all articles
Browse latest Browse all 4829

Error: Nothing handled the action over and over

$
0
0

@mateuszosuch wrote:

I am facing issue I cannot overcome within the “Error: Nothing handled the action (…) description”. I tried almost everything (changed naming, moved snippet from component to controller, made sure my code is exactly the same as on example and more) but I still cannot trigger simple action by clicking on button.

So from the very beginning: I am newbie in Ember and I am trying to trigger function, which is hooked using {{action}} property.

For that, I have created:

Route: sign-up.js Template: sign-up.hbs Component: sign-up.js

And I am following code as written here (nothing complex really): https://guides.emberjs.com/v2.18.0/templates/actions/

So I have placed in template file (also tried to embrace the below withing {{#sign-up}} but it did not work):

<h3><button {{action "toggleBody"}}>{{title}}</button></h3>
{{#if isShowingBody}}
  <p>{{{body}}}</p>
{{/if}}

Then I have place in component file:

import Component from '@ember/component';

export default Component.extend({
  actions: {
    toggleBody() {
      this.toggleProperty('isShowingBody');
    }
  }
});

Route file is as generated by default.

As a result of the above I get console error:

“Error: Nothing handled the action ‘toggleBody’. blabla”

I am out of ideas, really. Any thoughts?

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 4829

Trending Articles