私のページにはangularjsを使用しています。冗長性がないように、JSON オブジェクトから値をフィルター処理したい。しかし、Angular ng-repeat から一意の値を取得する方法が見つかりませんでした。とにかくそれを行うことはありますか?
わかりました、ここに質問についての説明があります。この形式の JSON があります。この JSON は、サービスから取得しています。したがって、繰り返しデータがどのように発生するかは予測できません。
result = [
{
_id: "500004",
subject: "Complete the task",
date: "25 Aug, 2013"
},
{
_id: "500004",
subject: "Complete the task",
date: "25 Aug, 2013"
},
{
_id: "500005",
subject: "Attend to the event",
date: "2 Jan, 2013"
},
{
_id: "500065",
subject: "Some task deadline",
date: "20 Sep, 2013"
},
{
_id: "500004",
subject: "Complete the task",
date: "25 Aug, 2013"
}
]
出力JSONに要素が繰り返されないようにしたいので、出力は次のようになります
result = [
{
_id: "500004",
subject: "Complete the task",
date: "25 Aug, 2013"
},
{
_id: "500005",
subject: "Attend to the event",
date: "2 Jan, 2013"
},
{
_id: "500065",
subject: "Some task deadline",
date: "20 Sep, 2013"
}
]