Angularjs orderBy子属性

Tro*_*sta 8 angularjs

嗨,我需要根据子属性订购角度列表.

我有这个型号:

  $scope.data = [{name:"John",type:{talent:"genius",val:99}},
                 {name:"Paul",type:{talent:"genius",val:89}},
                 {name:"Ringo",type:{talent:"lucky",val:29}}];
Run Code Online (Sandbox Code Playgroud)

我需要显示一个只有人才的名单.所以我尝试这样的事情:

item in data|orderBy:{type.val}
Run Code Online (Sandbox Code Playgroud)

http://jsbin.com/ObIqUyix/4/edit

小智 15

item in data|orderBy:'type.val'
Run Code Online (Sandbox Code Playgroud)