URL: http:/localhost:4200/bands
Ember.js version: 2.18.0
/templates/bands.hbs
{{input type="text" class="new-band" placeholder="New Band" value=name}}
<button class="btn btn-primary btn-sm new-band-button" onclick={{action "createBand"}}>Add</button>
/controllers/bands.js
export default Controller.extend({
name: 'abc',
actions: {
createBand(){
var x = this.get('name');
this.set('name', '');
}
}
});
The x in createBand() funciton is always ‘abc’ whatever I typed in. Anyone can help?