【发布时间】:2017-03-12 22:35:03
【问题描述】:
我开始使用 emberjs,我已将我的 ember 应用程序连接到 API,并且我的模型工作正常。 我可以在模板中显示模型,但如何过滤它们? 例如,这是我的模型:
import DS from 'ember-data';
export default DS.Model.extend({
placeofdamage: DS.attr('string'),
ees: DS.attr(),
type: DS.belongsTo('type'),
brand: DS.belongsTo('brand')
});
如何显示 ex.只有宝马?用这个方法:
<select class="form-control" id="selectBrand">
{{#each model.brands as |brand|}}
<option>{{brand.name}}</option>
{{/each}}
</select>
感谢您的进一步回复。
【问题讨论】:
标签: ember.js