首页 > 解决方案 > 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)。

我错过了什么更新或我需要修改我的代码?

标签: ng-zorro-antd

解决方案


可能你应该看看选项[nzShowTotal],它应该指定一个模板。

[nzShowTotal]="totalTpl" ...... <ng-template #totalTpl let-range="range" let-total>{{ 'Total: ' + total}}</ng-template>


推荐阅读