Si vous voyez un message d’erreur tel que
error.txt
Error: src/app/my-component/my-component.component.html:2:1 - error NG8002: Can't bind to 'routerLink' since it isn't a known property of 'p-button'.
1. If 'p-button' is an Angular component and it has 'routerLink' input, then verify that it is part of this module.
2. If 'p-button' is a Web Component then add 'CUSTOM_ELEMENTS_SCHEMA' to the '@NgModule.schemas' of this component to suppress this message.
3. To allow any property add 'NO_ERRORS_SCHEMA' to the '@NgModule.schemas' of this component.dans votre application angular, ouvrez le fichier de module qui déclare votre composant (typiquement app.module.ts) et ajoutez
app.module.ts
RouterModule,à ses imports, par exemple :
app.module.ts
imports: [
CommonModule,
RouterModule,
]
Consultez les articles similaires par catégorie :
Angular
Si cet article vous a aidé, pensez à m'offrir un café ou à faire un don via PayPal pour soutenir la recherche et la publication de nouveaux articles sur TechOverflow