' app-sidenav-list'不是已知元素

发布于 2025-02-11 05:12:02 字数 524 浏览 1 评论 0原文

当我创建Sidenav选项卡时。但是将其用于HTML时会遇到一些错误。

要检查错误,请找到屏幕快照。 错误

要检查模块导入文件,请检查ScreenSot- app.module.ts

'app-sidenav-list'不是已知元素:

  1. 如果“ app-sidenav-list”是一个角度组件,然后验证它是该模块的一部分。
  2. 如果“ app-sidenav list”是一个Web组件,则将“ custom_elements_schema”添加到此组件的“@ngmodule.schemas”中,以抑制此消息。

when I create sidenav tabs. but getting some errors while using it into HTML.

To check the error please find the screenshot as-
Error

To check the module imports file please check the screensot - app.module.ts

'app-sidenav-list' is not a known element:

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

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

情仇皆在手 2025-02-18 05:12:02

请检查您是否已在app.module.ts中导入了Sidenavlist组件。

import { NgModule } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';

import { AppRoutingModule } from './app-routing.module';
import { AppComponent } from './app.component';

import { SideNavList} from './side-nav-list.component';  //Add your component name and path

@NgModule({
  declarations: [
    AppComponent,
    SideNavList     //import your component
  ],
  imports: [
    BrowserModule,
    AppRoutingModule
  ],
  providers: [],
  bootstrap: [AppComponent]
})
export class AppModule { }

Please check if you have imported the SidenavList component in your app.module.ts.

import { NgModule } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';

import { AppRoutingModule } from './app-routing.module';
import { AppComponent } from './app.component';

import { SideNavList} from './side-nav-list.component';  //Add your component name and path

@NgModule({
  declarations: [
    AppComponent,
    SideNavList     //import your component
  ],
  imports: [
    BrowserModule,
    AppRoutingModule
  ],
  providers: [],
  bootstrap: [AppComponent]
})
export class AppModule { }

一念一轮回 2025-02-18 05:12:02

当未在app.module.ts文件中添加有关组件时,通常会发生这种情况。
请验证并相应确认。

This typically happens when the component in question has not been added in app.module.ts file.
Please verify and confirm accordingly.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文