angular - 无法绑定到“zIndex”,因为它不是“ng2-dropdown-menu”的已知属性
问题描述
我的项目昨天运行良好。当我早上开始运行它时,它给了我这个错误。
If 'ng2-dropdown-menu' is an Angular component and it has 'zIndex' input, then verify that it is part of this module.
2. If 'ng2-dropdown-menu' 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. ("namicUpdate">
<ng2-dropdown-menu [focusFirstElement]="focusFirstElement"
[ERROR ->][zIndex]="zIndex"
[appendToBody]="appendToBody"
[offset"): ng:///TagInputModule/TagInputDropdown.html@2:23
at syntaxError (compiler.es5.js:1694)
at TemplateParser.parse (compiler.es5.js:12791)
at JitCompiler._compileTemplate (compiler.es5.js:26994)
at compiler.es5.js:26913
at Set.forEach (<anonymous>)
at JitCompiler._compileComponents (compiler.es5.js:26913)
at compiler.es5.js:26800
at Object.then (compiler.es5.js:1683)
at JitCompiler._compileModuleAndComponents (compiler.es5.js:26799)
at JitCompiler.compileModuleAsync (compiler.es5.js:26728)
这ng2-dropdown-menu
是在https://github.com/benfoley/angular2-tag-input包中。
提前致谢。
解决方案
你需要导入{ Ng2DropdownModule }
import { Ng2DropdownModule } from 'ng2-material-dropdown';
@NgModule({
imports: [
Ng2DropdownModule
],
同样在您需要做的组件中,
import { Ng2Dropdown, Ng2MenuItem } from 'ng2-material-dropdown';
还添加一个输入,
@Input() public zIndex = new defaults().zIndex;
还升级你的包ngx-chips
推荐阅读
- java - 如何在没有比较器的Java中使用MergeSort对对象数组进行排序
- javascript - 跨多个页面的多个 iframe 不同?
- sas - 在proc sql中按多个变量分组时为缺失值添加行
- python - 在 RPN 中显示预测的 boxex(Tensorflow Faster-RCNN)
- c# - 无法通过 UDP 连接到设备
- javascript - Uncaught (in promise) SyntaxError: Unexpected token < in JSON at position 0 in vue-js/babylon.js 项目
- c# - 带有输入字段和下拉列表、动态值的 C# Unity 搜索栏
- android - 应用内购买 BILLING_RESPONSE_RESULT_DEVELOPER_ERROR,颤振
- powershell - 从 CSV 获取 2 列的 ADUser
- javascript - 上传后从 AWS S3 获取上传的文件