【问题标题】:Ng2-pagination errorNg2-分页错误
【发布时间】:2016-07-29 22:03:55
【问题描述】:

我是 Angular2 的新手,我想在我的应用程序中添加分页,但是在使用 ng2-pagination 时出现此错误。

NG2-Pagination ERROR

我使用了以下基本示例: http://michaelbromley.github.io/ng2-pagination/

所以我的组件上有这个:

import {ChangeDetectionStrategy, Component, EventEmitter} from 'angular2/core';       
import {PaginatePipe, PaginationControlsCmp, PaginationService} from 'ng2-pagination';


@Component({

    selector: 'consultaVehicle',
    templateUrl: 'app/components/home/vehicles/consultaVehicle.html',
    providers: [VehicleService, MarcaModelsService],
    directives: [PaginationControlsCmp],
    pipes: [PaginatePipe],
    changeDetection: ChangeDetectionStrategy.OnPush
})

我已经在 index.html 中导入了包: /dist/ng2-pagination-bundle.js"

版本:

"ng2-pagination": "^0.3.4",
"angular2": "2.0.0-beta.0",

谢谢!

【问题讨论】:

    标签: angular pagination


    【解决方案1】:

    您可能需要添加“PaginationService”作为提供程序 例如

    providers: [PaginationService , VehicleService, MarcaModelsService],
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2016-08-20
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2020-07-08
      • 2017-08-15
      • 2017-11-23
      • 2016-05-06
      相关资源
      最近更新 更多