I have here this function in my service.ts
public getUploadPeriod(){
let baseYear = 2020;
let currYear = new Date().getFullYear();
let years = [];
for (var i = baseYear; i <= currYear; i++) {
years.push(i);
}
return years
}
And this is the ts of my project I am trying to call out the function that I create in service.ts
getUploadPeriod() {
const years = this.uploadFacilityService.getUploadPeriod();
console.log(years)
return years
}
And this is my html
<mat-select
placeholder="Select Time Period">
<mat-option value="">
{{ years }}
</mat-option>
</mat-select>
The years are already generated with the function that I created but theres no display in my dropdown list. Can someone help me with this. Thank you!