dimanche 7 janvier 2018

ember js trigger actions on my route

current URL: http://localhost:4200/bands

router.js:

Router.map(function() {
    this.route('bands', function(){
        this.route('band', {path: ':slug'}, function(){
          this.route('songs');
          this.route('albums');
      });
    });
});

app/routes/bands.js

export default Route.extend({
    actions: {
      createBand: function(){
         this.get('controller').set('name', '');
      }
    }
});

app/templates/bands.hbs


<button class="btn btn-primary btn-sm new-band-button" >Add</button>

It looks like the createBand() function cannot be triggered. Am I missing anything?




Aucun commentaire:

Enregistrer un commentaire