問題:
スタンドアロンコンポーネントを使用して Angular アプリを開くと、次のエラーメッセージが表示されます:
angular_router_error.txt
Can't bind to 'routerLink' since it isn't a known property of 'a'解決策
エラーが発生したコンポーネントで、次を追加します:
import_router_module.ts
import { RouterModule } from '@angular/router';そして次を追加します:
router_module_import_example.ts
RouterModule,をコンポーネントの imports に追加します。例:
top_bar_component.ts
@Component({
selector: 'app-top-bar',
standalone: true,
imports: [
CommonModule,
RouterModule
],
templateUrl: './top-bar.component.html',
styleUrl: './top-bar.component.sass'
})
export class TopBarComponent {
}
同じカテゴリの類似記事をチェック:
Angular TypeScript
この記事が役に立った場合は、TechOverflow での新しい記事の調査と公開を支援するため、「Buy Me a Coffee」でのご支援、または PayPal 経由でのご寄付をご検討ください