0
companies
和ships
都具有name
屬性。但我不明白我怎麼可以在這個代碼中使用sortProperties
:按名稱排序屬性
的app/controllers/index.js
import Ember from 'ember';
export default Ember.Controller.extend({
selectedCompany: null,
companies: function(){
var model = this.get('model.companies');
return model;
}.property(),
ships: function(){
var model = this.get('model.ships');
return model;
}.property()
});
應用程序/路由/ index.js
import Ember from 'ember';
export default Ember.Route.extend({
model: function() {
return {
companies: this.store.find('company'),
ships: this.store.find('ship')
};
}
});
如何通過name
屬性對companies
和ships
進行排序?