I have a method getMonths() and I wanted to add an argument year to it. The method is only used in one place:
<div *ngFor="let month of getMonths()" class="calendar-table">
...
</div>
If I add the argument to the method getMonths(year) and change the code above to call getMonths(selectedYear) angular gives me the following error:
ERROR in src/app/user-calendar/user-calendar.component.ts:108:27 - error TS2554: Expected 1 arguments, but got 0.
108 for(let month of this.getMonths()) {
~~~~~~~~~~~
src/app/user-calendar/user-calendar.component.ts:35:13
35 getMonths(year) {
~~~~
An argument for 'year' was not provided.
Notice, that angular seems to use the previous version of my template, where selectedYear is not provided. I tried to kill ng serve and run it again, I also tried to run ng build --prod but the error remains.
Unlike in the error message the template looks like this:
<div *ngFor="let month of getMonths(selectedYear)" class="calendar-table">
...
</div>