ember.js - Populate a select box with results generated from another select box -
another new-to-ember question - have component contains select (call type) object. when type selected, want take selected type, make rest call using selected type return records, , populate second select object in component returned records. there many subtypes during initialization (the type list retrieved during initialization). process is: 1) select value type chosen 2) type chosen sent parent route , set there 3) value chosen used rest service list of subtypes. works now, have been unable set the component select subtypes retrieved rest service. been beating head against while now, appreciated. thanks.
basically when rest call returns, set result prop on controller. then, bind prop second select's content
.
// some/route.js fetchblah(param) { return ember.$.getjson('/some/path', {some: param}).then(result => { this.controller.set('fetcheddata', result); }); } // some/template.hbs {{view 'select' content=fetcheddata}}
Comments
Post a Comment