遇到如下的错误消息:
Failed to compile.
src/app/ngrxdemo/searchbookcomponents/search-input/search-input.component.html:4:3 - error NG8001: ‘nz-input-group’ is not a known element:
- If ‘nz-input-group’ is an Angular component, then verify that it is part of this module.
- If ‘nz-input-group’ is a Web Component then add ‘CUSTOM_ELEMENTS_SCHEMA’ to the ‘@NgModule.schemas’ of this component to suppress this message.
4 <nz-input-group [nzSuffix]=“suffixIconSearch” class=“search”>
添加如下依赖到package.json:
“ng-zorro-antd”: “^7.5.1”,
npm install:
发现一系列warning,原因是因为ng-zorro-antd和Angular的版本不一致:
加入下列语句后问题解决:
import {NgZorroAntdModule} from ‘ng-zorro-antd’;
要获取更多Jerry的原创文章,请关注公众号"汪子熙":
JerryWang,2007年从电子科技大学计算机专业硕士毕业后加入SAP成都研究院工作至今。Jerry是SAP社区导师,SAP中国技术大使。2020年5月下旬,Jerry做了脑部肿瘤的开颅切除手术,对编程和人生又有了新的感悟。