My task is to take an object with data and display it in two separate lists. The structure of the object is as follows:
var data = [
{name: "Something 1", active: 1, datetime: "goes", author: "here"},
{name: "Something 2", active: 0, datetime: "goes", author: "here"},
{name: "Something 3", active: 0, datetime: "goes", author: "here"}
];
I am looking to segregate the active and inactive data from this object. What would be the best approach for achieving this?
Option 1: Using Filter
<li ng-repeat="out in data | filter:{'active':1}">{{out.name}}</li>
Option 2: Using ng-hide directive (for inactive)
<li ng-repeat="out in data" ng-hide="out.active">{{out.name}}</li>