我还是个新手,这是我的第一个项目,所以这个过程可能是显而易见的.我按照Shoelace Angular Integration英里的速度走了几步,但我无法让它运转起来.我注意到在npmjs.com也有一个可用的包,但我不想依赖它,因为它看起来可能会被放弃,并适用于v14.
我如何使用我在本教程之后创建的AppModule呢? 我也读过类似的问题,但我无法修复它.
我try 将schemas: [CUSTOM_ELEMENTS_SCHEMA]
添加到我的组件中,但我遇到了相同的错误,这真的很令人困惑.
我如何在不进入依赖地狱的情况下导入它?
以下是我得到的信息:
X [ERROR] NG8001: 'app-drawer-example' is not a known element:
1. If 'app-drawer-example' is an Angular component, then verify that it is included in the '@Component.imports' of this component.
2. If 'app-drawer-example' is a Web Component then add 'CUSTOM_ELEMENTS_SCHEMA' to the '@Component.schemas' of this component to suppress this message. [plugin angular-compiler]
src/app/app.component.html:5:0:
5 │ <app-drawer-example></app-drawer-example>
╵ ~~~~~~~~~~~~~~~~~~~~
Error occurs in the template of component AppComponent.
src/app/app.component.ts:11:15:
11 │ templateUrl: './app.component.html',
╵ ~~~~~~~~~~~~~~~~~~~~~~
X [ERROR] NG8001: 'sl-drawer' is not a known element:
1. If 'sl-drawer' is an Angular component, then verify that it is part of this module.
2. If 'sl-drawer' is a Web Component then add 'CUSTOM_ELEMENTS_SCHEMA' to the '@NgModule.schemas' of this component to suppress this message. [plugin angular-compiler]
src/app/app.component.ts:21:79:
21 │ ...r</button><sl-drawer #drawer label="Drawer" class="drawer-focus...
╵ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~