Ionic component - all red in VSCode html editor

Viewed 295

I am using VSCode to write my Ionic5 app. While autocompletion of HTML code works and the editor recognizes all specific Ionic html keywords, it fails to do so when I edit a HTML of an ionic component that only has the inner body of a page, not the whole page.

For instance, my component starts with

<ion-grid>
  <ion-row class="ion-align-items-center" >
    <ion-col size="9" (click)="openFullView()">

and all ion keywords are marked in red as "unknown element" . If I use them in a proper Ionic page, all's well. I guess I am missing a VSCode setting or an include in my source?

EDIT: I ran into this issue and I think it is related. Add IonicModule to the component. It is missing in the ionic boilerplate code.

0 Answers
Related