Visual Studio Code (1.17.0) generates errors in Angular templates when I address members from inherited types that are not on the base class and the base class is declared on the component.
In the code below, obviously maxLength does not exist on QuestionBase, but how do I go about this?
[Angular] Identifier 'maxLength' is not defined. 'QuestionBase' does not contain such a member
export class QuestionBase {
id: number;
order: number;
}
export class TextQuestion extends QuestionBase {
maxLength: number
}
On the component question is declared as QuestionBase, so that it can become any kind of question
@Import question: QuestionBase
Now in the html template I addres the maxLength property:
<input type="text" class="form-control" id="maxLength" [(ngModel)]="question.maxLength" name="maxLength" />