以下是我的代码错误是路由器元素不是已知元素。附上代码截图:
应用路由模块
应用模块
应用组件.ts
应用组件.html
您应该将 ProductCardComponent 和 LoginComponent 导入到 app.module.ts 并添加 ProductCardComponent 和 LoginComponent 在 declarations:[]
ProductCardComponent
LoginComponent
app.module.ts
declarations:[]