At the moment, I am fetching carType data like this:
Truck
SUV
Sedan
Truck
SUV
What I want is to create a filter select box with options that do not repeat, like so:
Truck
Sedan
SUV
Currently, my issue is that my select box shows all CarType results including duplicates which I want to remove.
Additionally, my result display after applying a filter is not functioning properly and I cannot identify where exactly the problem lies.
<label for="filters">Filter by Car Type</label>
<select id="filters" ng-model="selectedType" ng-options="x.type as x.type for x in result">
<option value="">Select Car Type</option>
</select>
In the table where I intend to show results based on filters:
<tr ng-repeat="x in result|filter:selectedTDL">
<td data-title="Car Type">{{x.type}}</td>
<td data-title="Year">{{x.year}}</td>
</tr>
I am not sure what is missing or incorrect causing the results to not display properly.
UPDATE: I managed to fix the filtering issue and now the display is based on the filtered option. However, I am unsure how to eliminate duplicates in the filter dropdown menu.