This is my Filter:
app.filter('ticketsFilter', function (){
return function (input){
var data = input;
console.log("Filtered object:")
console.log(data);
return input;
};
});
This is my Markup:
<tr ng-repeat="ticket in tickets | ticketsFilter">
<p> {{ticket.createdByName}} </p>
<p> {{ticket.title}} </p>
<p> {{ticket.toDpt}} </p>
</tr>
The tickets Object is a Object of Objects. On my DB, there are 4 instances of tickets. And, when my ticket hits the filter, the Filtered Object is displayed as:
[Object, Object, Object, Object]
I could not figure out how to acess these objects. I've tried to use $index, received a dependency injection. Tried to use a (for x in input) loop, but the console.log will only display the last object properties. I've tried for(i, i
I can properly acess my objects properties using this:
console.log(data[0].attribute);
But I dont know how to iterate and acess data[i] instead of data[0]. Well, any tips on how to acess my Object Objects index? I can give more code if needed.
Thanks for any advice.
@EDIT
This is how my console.log($scope.tickets) looks like:
fromDpt: Array[4]
0: Object
1: Object
2: Object
3: Object
Every Object looks like this:
0: Object
__v: 0
_id: "55ddb1e6ca11301020ef9b77"
createdAt: "1440592358061"
createdById: "55d758ee3a7ff720141a18f8"
__proto__: Object