私は結果をその位置でフィルタリングしようとしています。orderBy:notarray予想される配列ですが、受信しました:オブジェクト
しかし、すぐにorderbyの結果が配列ではないので、ページを分割します。これをどうやって変更できますか?私はこれに固執しています。
私はそうのように、この操作を行います。
<div ng-repeat="cat in content | orderBy : 'pos'" class="animated zoomIn">
とコントローラ:
{
"Bar One" : {
"bgurl" : "https://domain.com/aa/bars/list/bar.jpg",
"name" : "Bar One",
"subtitle" : "Cheers",
"pos", 2
},
"Bar Two" : {
"bgurl" : "https://domain.com/aa/bars/list/bar.jpg",
"name" : "Bar Two",
"subtitle" : "Cheers",
"pos", 1
}
}
、私はこのエラーを取得:
firebase.database().ref("v3/standalonelist/" + catId.toLowerCase()).on('value', function(snapshot) {
$timeout(function() {
$scope.content = snapshot.val();
console.log($scope.content);
})
});
の$ scope.contentは、このオブジェクトを返します
[orderBy:notarray] Expected array but received: [THE OBJECT ABOVE]
エラーが真である、これはオブジェクトであります別のオブジェクトをラップします。あなたのコンテンツは以下のようになります:$ scope.content = [ { "bgurl": "https://domain.com/aa/bars/list/bar.jpg"、 "name": "Bar One" "サブタイトル"、 "乾杯"、 "POS"、2 }、{ "bgurl": "https://domain.com/aa/bars/list/bar.jpg"、 "名前" : "バー二"、 "字幕": "乾杯"、 "POS"、1 } ] – oguzhan00