ng-zorro-antd - NzPaginationComponent got TypeError: templateRef.createEmbeddedView is not a function
问题描述
在我将 ng-zorro-antd 更新到 1.1.1 版和 Angular 到 6.0.7 版后,我收到了 NzPaginationComponent.html:1 的以下错误:
错误类型错误:templateRef.createEmbeddedView 不是 NgTemplateOutlet.push../node_modules/@ 的 ViewContainerRef_.push../node_modules/@angular/core/fesm5/core.js.ViewContainerRef_.createEmbeddedView (core.js:8559) 的函数angular/common/fesm5/common.js.NgTemplateOutlet.ngOnChanges (common.js:3834) 在 checkAndUpdateDirectiveInline (core.js:9038) 在 checkAndUpdateNodeInline (core.js:10306) 在 checkAndUpdateNode (core.js:10268) 在 debugCheckAndUpdateNode ( core.js:10901) 在 debugCheckDirectivesFn (core.js:10861) 在 Object.eval [as updateDirectives] (NzPaginationComponent.html:1) 在 Object.debugUpdateDirectives [as updateDirectives] (core.js:10853) 在 checkAndUpdateView (core. js:10250)。
我错过了什么更新或我需要修改我的代码?
解决方案
可能你应该看看选项[nzShowTotal],它应该指定一个模板。
[nzShowTotal]="totalTpl"
......
<ng-template #totalTpl let-range="range" let-total>{{ 'Total: ' + total}}</ng-template>
推荐阅读
- gcloud - Gcloud 错误 401:请求具有无效的身份验证凭据
- javascript - For Loop 上的 Click() 仅适用于第一个按钮
- wordpress - 我的 WordPress 中没有“我的网站”按钮
- postgresql - 在 psql 中,如何使用 CTE 为 Select 查询运行循环并获得只读数据库中显示的输出?
- python - 使用 selenium 无限滚动时摆脱弹出窗口
- c# - 展开时 WinForms TreeView 故障
- asp.net-core - 如何在 Visual Studio 2019 16.8.3 Build 中禁用 ASP.NET Core API 3.1 项目的 SSL?
- qemu - libvirt:在 NUMA 系统上使用大页面
- php - 在网页上编辑 XML 文件并使用 PHP 保存回 XML 文件
- python - 类型错误:str() 最多接受 3 个参数(给定 8 个)