- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
这是我的 HTML 分页标签
<pagination class="pagination-sm" [(ngModel)]="page" [totalItems]="length" [itemsPerPage]="itemsPerPage" [maxSize]="maxSize" [boundaryLinks]="true" [rotate]="false" (pageChanged)="changePage($event)" (numPages)="numPages = $event"></pagination>
和我的模型文件
import { Injectable } from '@angular/core';
import { NgbPaginationConfig} from '@ng-bootstrap/ng-bootstrap';
@Injectable()
export class PaginationConfig {
constructor(private config: NgbPaginationConfig) {
config.boundaryLinks = true;
config.maxSize = 5;
config.pageSize = 20;
config.size = 'sm';
}
}
我正在使用@ng-bootstrap/ng-bootstrap 的 GitHub 包,当时出现以下错误
Unhandled Promise rejection: Template parse errors:
Can't bind to 'itemsPerPage' since it isn't a known property of 'pagination'. ("
</tbody>
</table>
<pagination class="pagination-sm" [(ngModel)]="page" [ERROR ->][itemsPerPage]="itemsPerPage" [maxSize]="maxSize" [boundaryLinks]="true" [rotate]="false" (pageChange"): ng:///TeamModule/TeamComponent.html@83:54
Can't bind to 'maxSize' since it isn't a known property of 'pagination'. ("tbody>
</table>
<pagination class="pagination-sm" [(ngModel)]="page" [itemsPerPage]="itemsPerPage" [ERROR ->][maxSize]="maxSize" [boundaryLinks]="true" [rotate]="false" (pageChanged)="changePage($event)" (numPa"): ng:///TeamModule/TeamComponent.html@83:84
Can't bind to 'boundaryLinks' since it isn't a known property of 'pagination'. ("ination class="pagination-sm" [(ngModel)]="page" [itemsPerPage]="itemsPerPage" [maxSize]="maxSize" [ERROR ->][boundaryLinks]="true" [rotate]="false" (pageChanged)="changePage($event)" (numPages)="numPages = $ev"): ng:///TeamModule/TeamComponent.html@83:104
Can't bind to 'rotate' since it isn't a known property of 'pagination'. ("on-sm" [(ngModel)]="page" [itemsPerPage]="itemsPerPage" [maxSize]="maxSize" [boundaryLinks]="true" [ERROR ->][rotate]="false" (pageChanged)="changePage($event)" (numPages)="numPages = $event"></pagination>
</di"): ng:///TeamModule/TeamComponent.html@83:127
'pagination' is not a known element:
1. If 'pagination' is an Angular component, then verify that it is part of this module.
2. To allow any element add 'NO_ERRORS_SCHEMA' to the '@NgModule.schemas' of this component. ("
</tbody>
</table>
[ERROR ->]<pagination class="pagination-sm" [(ngModel)]="page" [itemsPerPage]="itemsPerPage" [maxSize]="maxSiz"): ng:///TeamModule/TeamComponent.html@83:0 ; Zone: <root> ; Task: Promise.then ; Value: Error: Template parse errors:
Can't bind to 'itemsPerPage' since it isn't a known property of 'pagination'. ("
</tbody>
</table>
仅在加载时出现上述错误
最佳答案
我想念模型文件 import ng-bootstrap
import {NgbModule} from '@ng-bootstrap/ng-bootstrap';
并在 @NgModel 内部为 root 导入
NgbModule.forRoot()
编辑:请注意 NgbModule 的 forRoot() 自 3.0.0 起已弃用,并将从 4.0.0 中删除。相反,建议只导入
NgbModule
关于angular - 无法绑定(bind)到 'totalItems',因为它不是 'pagination' 的已知属性,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47332509/
我正在编写一个 Powershell 脚本,该脚本将仅返回 Exchange 2003 邮箱中的所有项目。到目前为止,我有这个: get-wmiobject -computername exchang
使用 YouTube API。试图在 json.data.totalItems == 0 时获得警报(“没有搜索结果”),但它没有发生,什么也没有发生...当 json.data.totalItems
这是我的 HTML 分页标签 和我的模型文件 import { Injectable } from '@angular/core'; import { NgbPaginationConfig} fr
这是我的 HTML 分页标签 和我的模型文件 import { Injectable } from '@angular/core'; import { NgbPaginationConfig} fr
我有一个 JAVA 程序,可以向 Google Books API 发送 HTTP GET 消息。 我想获得满足搜索条件“ cooking ”的书籍。 响应中的最大项目数是 40,这是我在 GET 消
我是一名优秀的程序员,十分优秀!