次のような JSON オブジェクトがあります。
$scope.object = {
'thing1': {
'content': 'blah blah',
'order': '1',
},
'thing2': {
'content': 'blah blah blah',
'order': '2',
},
}
「コンテンツ」キーに対応する値を配列に追加したいと思います。これでうまくいくと思いました:
var things=[];
for (x in $scope.object){
things.push(x.content);
}
それは動作しません。undefined を返すだけです。何か案は?