I want to show different different values from JSON data depending on a drop down selection.
<div>
<label for="input-one">select</label>
</div>
<div>
<select>
<option value="">--- Select ---</option>
<option value="1">option1</option>
<option value="2">option2</option>
<option value="3">option3</option>
</select>
</div>
This is the drop down selection. What is the best approach to show the JSON data based on a selection?
For example:
- If you select
1, it should show 2 values from JSON data. - If you select
2, it should show 3 values from JSON data. - If you select
3, it should show all JSON data.
I want to do this in Angular 2. Please suggest me what could be the solution.