dimanche 26 février 2017

Ember.js: Assertion Failed: An action named 'actionTest' was not found in (generated myroute controller)

I'm trying to use the component bs-button of Ember Bootstrap to dispatch a simple action that will write something in the log. For this, I've created a new app using ember-cli and installed ember-bootstrap according the project Github page.

Then, I've created a route using ember-cli (ember g route myroute) and wrote the code below:

app/routes/myroute.js

import Ember from 'ember';

export default Ember.Route.extend({

  actions: {
    actionTest(value){
      console.log('on actionTest:', value);
    }
  }

});

app/templates/myroute.hbs

Run test action

But when I try to access, the following error appears in console (nothing is rendered):

message: "Assertion Failed: An action named 'actionTest' was not found in (generated myroute controller)"

Followed by:

Uncaught TypeError: Cannot read property 'getAttribute' of undefined

Maybe a completely stupid error, but I haven't found nothing on docs neither on examples.

Environment:

ember-cli:

$ ember -v
ember-cli: 2.10.1
node: 6.9.2
os: darwin x64

chrome console:

DEBUG: -------------------------------
DEBUG: Ember      : 2.10.2
DEBUG: Ember Data : 2.11.3
DEBUG: jQuery     : 3.1.1
DEBUG: -------------------------------




Aucun commentaire:

Enregistrer un commentaire