I'm working on an angular project. It is working perfectly. But it is failing a linting test. This question wasn't very helpful. This the error I'm getting:
ERROR: C:/Users/.../monthpicker.component.ts:164:22 - Type assertion using the '<>' syntax is forbidden. Use the 'as' syntax instead.
Lint errors found in the listed files.
And that line 164 is in my ts file:
testMethod() {
this.text = (<HTMLInputElement>document.getElementById('rangeInput')).value;
}
I'm new to Angular. I don't know what to do. I cant remove <>
because rangeInput
is an input element in my HTML:
<input id="rangeInput" [ngModel]="text" placeholder="Select range" />
Please help me. How to fix this and pass this linting test. I'm using Node v10.15.3
.
PS: there is no error or warning when this project runs. It happens only during git push
when it starts linting tests.