I have this object:
0: {year: "2015", period: ["P1"]}
1: {year: "2016", period: ["P1", "P2"]}
2: {year: "2017", period: ["P1", "P2", "P3"]}
And I wanna do 2 select-option:
When I press on 2015 on the first
select-option, the values on the secondselect-optionto beP1.When I press on 2016 on the first
select-option, the values on the secondselect-optionto beP1,P2.When I press on 2017 on the first
select-option, the values on the secondselect-optionto beP1,P2,P3.
Something dinamically basically. I tried this:
<select>
<option disabled value="null">Select year</option>
<option *ngFor="let item of fps" [value]="item.year">
{{ item.year }}
</option>
</select>
<select>
<option disabled value="null">Select period</option>
<option *ngFor="let item of fps" [value]="item.period">
{{ item.period }}
</option>
</select>
but this will give me: (same with 2016 and 2017)
How can I modify in order to obtain what I want? Thank you for your time!
