gpt4 book ai didi

angular - 无法绑定(bind)到 'options',因为它不是 'p-dropdown' 的已知属性

转载 作者:行者123 更新时间:2023-12-03 23:37:46 26 4
gpt4 key购买 nike

尝试将 primeNG 下拉列表添加到 userform.component.ts 时出现此错误,我已引用此但无济于事,因为我已经实现了此修复:primeng dropdown component error ('p-dropdown' is not a known element)

Uncaught Error: Template parse errors:
Can't bind to 'options' since it isn't a known property of 'p-dropdown'.
1. If 'p-dropdown' is an Angular component and it has 'options' input, then verify that it is part of this module.
2. If 'p-dropdown' 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. ("<p-dropdown [ERROR ->][options] = "technologies" [autoWidth] = "false" id = "technologies"></p-dropdown>

GIT repo : https://github.com/BillyCharter87/Tech-O-Dex

谢谢!

最佳答案

通常,当您错过一些导入时会发生此错误。
如果缺少,请添加以下行:

import { FormsModule, ReactiveFormsModule } from '@angular/forms';
import { DropdownModule } from 'primeng/primeng';

并将它们添加到导入中。

关于angular - 无法绑定(bind)到 'options',因为它不是 'p-dropdown' 的已知属性,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46384791/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com