I'll go through an example just for testing:
In this example when I put filter:chart.id='1'
, in addition it returns me the id 1 it returns me the id 10, how would I make it return only the id = 1?
function TodoCtrl($scope) {
$scope.chartList = [
{ "id" : 1, "name" : "chart 1", "order" : 1, "active" : false },
{ "id" : 2, "name" : "chart 2", "order" : 2, "active" : false },
{ "id" : 3, "name" : "chart 3", "order" : 3, "active" : true },
{ "id" : 4, "name" : "chart 4", "order" : 4, "active" : true },
{ "id" : 10, "name" : "chart 10", "order" : 5, "active" : true }
];
}
.done-true {
text-decoration: line-through;
color: grey;
}
<div ng-app>
<div ng-controller="TodoCtrl">
<select ng-model="toAddChart" ng-options="chart.id as chart.name for chart in chartList | filter:chart.id='1'">
<option value=""></option>
</select>
</div>
</div>