Karem Jouini
Karem Jouini

Reputation: 23

clr-datagrid is not a known element error NG8001

Same for clr-column clr-row , even after importing ClarityModule approprietly

import { GestionFournisseursComponent } from './gestion-fournisseurs/gestion-fournisseurs.component';
import {ClarityModule} from '@clr/angular';


@NgModule({
  declarations: [GestionFournisseursComponent],
  imports: [
    CommonModule,
    ReferentielRoutingModule,
    ClarityModule
  ]
})
export class ReferentielModule { }

HTMl:

<clr-datagrid></clr-datagrid>

Error:

Error: src/app/main/referentiel/gestion-fournisseurs/gestion-fournisseurs.component.html:2:1 - error NG8001: 'clr-datagrid' is not a known element:

  1. If 'clr-datagrid' is an Angular component, then verify that it is part of this module.
  2. If 'clr-datagrid' is a Web Component then add 'CUSTOM_ELEMENTS_SCHEMA' to the '@NgModule.schemas' of this component to suppress this message.

2


src/app/main/referentiel/gestion-fournisseurs/gestion-fournisseurs.component.ts:6:16
  6   templateUrl: './gestion-fournisseurs.component.html',
                   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  Error occurs in the template of component GestionFournisseursComponent.

I tried importing the ClarityDatagridModule only, reinstalled clarity , angular , dependencies but always the same error , any help will be appreciated .

Thanks in advance.

Upvotes: 1

Views: 1040

Answers (1)

Alvaro ML
Alvaro ML

Reputation: 31

I had the same issue with Angular 12.2.17 and Clarity 12.0.7 After adding Clarity with the following command:

ng add @clr/[email protected]

At this point, I had the error. To fix it, I just used the command:

npm install @clr/ui --save

I got this command from the Clarity documentation https://clarity.design/documentation/get-started. This solved the error in my case.

Upvotes: 0

Related Questions