Ich habe ein Array von Objekten. Ich muss die Daten nach einem Feld gruppieren und das Ergebnis in einer HTML-Tabelle anzeigen.Unbekannter Anbieter: groupByFilterProvider <- groupByFilter
INPUT:
[
{
id: "559e2bbc9a496034557d6d84",
text: "Data Sources",
topParentId: "559e2bbc9a496034557d6d84",
topParentText: "Data Sources"
},
{
id: "559e2bbc9a496034557d6d83",
text: "Applications",
topParentId: "559e2bbc9a496034557d6d83",
topParentText: "Applications"
},
{
id: "559e2bbc9a496034557d6d82",
text: "Analytics",
topParentId: "559e2bbc9a496034557d6d83",
topParentText: "Applications"
}
]
Von diesem Ich brauche eine HTML-Tabelle wie diese (Gruppierung Daten von topParentId) zu erstellen:
Group | Tags
Data Sources | Data Sources
Applications | Applications Analytics
Bisher habe ich dies getan:
<table class="table table-bordered">
<thead>
<tr>
<th>Group</th>
<th>Tags</th>
</tr >
</thead>
<tbody>
<tr ng-repeat="tag in topic.tags | groupBy: 'topParentId'">
<td>{{tag.topParentText}}</td>
</tr>
<tr>
<td>{{tag.text}}</td>
</tr>
</tbody>
</table>
Aber nach dem Ausführen dieses Codes bekomme ich Unknown provider: groupByFilterProvider <- groupByFilter
Fehler.
Ich bin AngularJS 1.2
enthalten Können Sie teilen "groupBy" Filter Deklaration – Chandermani
Haben Sie angular.filter enthalten? https://github.com/a8m/angular-filter – rmuller
@ruller: Ich habe mich gefragt, ob es eine eingebaute Funktion gibt. Ich habe angular-Filter nicht enthalten – SharpCoder