我在用ngx分页
app.module:
import { NgxPaginationModule } from 'ngx-pagination';
@NgModule({
declarations: [
AppComponent,
...
],
imports: [
...
NgxPaginationModule,
],.ts文件
p: Number = 1;
count: Number = 2;组件:
<li *ngFor="let data of this.lists; let i = index | paginate: { itemsPerPage: count, currentPage: p }"><a href="javascript:void(0)"> # {{ i+1 }} Test</a></li>获取此错误:
error NG5002:解析器错误:在this.lists的let数据中第50列处有意外的令牌\x;让I=索引\分页:{ itemsPerPage: count,currentPage: P} in ....component.html@67:32
任何解决这个问题的办法。谢谢
发布于 2022-02-28 14:33:14
你能试试这个吗?
<li *ngFor="let data of this.lists | paginate: { itemsPerPage: count, currentPage: p } index as i"><a href="javascript:void(0)"> # {{ i+1 }} Test</a></li>https://stackoverflow.com/questions/71296368
复制相似问题