cipchk / nz-schema-form

ng-zorro-antd form generation based on JSON-Schema
MIT License
40 stars 14 forks source link

按文档添加到ng-alian运行时报错 #23

Closed 80631004 closed 6 years ago

80631004 commented 6 years ago

ERROR Error: Uncaught (in promise): Error: Template parse errors: Can't bind to 'schema' since it isn't a known property of 'nz-sf'.

  1. If 'nz-sf' is an Angular component and it has 'schema' input, then verify that it is part of this module.
  2. If 'nz-sf' 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. ("

<nz-sf [ERROR ->][schema]="schema">"): ng:///DemoTableMgrModule/TableMgrAddComponent.html@17:7

cipchk commented 6 years ago

建议在 SharedModule 中导入

80631004 commented 6 years ago

在shared.module.ts中添加NzSchemaFormModule.forRoot() ,依然报上面错

xiaoheng008 commented 6 years ago

import中需要forRoot,export不需要forRoot@80631004