2015-05-26 81 views
0

我有產品下面的列表模型...EmberJS:排序按屬性模型屬於關聯

{ 
    products: [ 
     { 
      id: 1, 
      something: "value", 
      properties: { 
       name: "Name1" 
      } 
     }, 
     { 
      id: 2, 
      something: "value", 
      properties: { 
       name: "Name3" 
      } 
     }, 
     { 
      id: 3, 
      something: "value", 
      properties: { 
       name: "Name2" 
      } 
     } 
    ] 
} 

如果我通過在「product.properties.name」整理整理這些產品我會怎麼做?我最初的想法是使用sortableMixin並用下面的代碼片段:

sortProperties: ['properties.name'], 
sortAscending: true 

但是,這並沒有真正的產品,結果我的本意。我應該怎麼做呢?

回答