Ngx-bootstrap: Pagination: v1.1.16-7 PaginationConfig error

Created on 19 Dec 2016  路  2Comments  路  Source: valor-software/ngx-bootstrap

After upgrading to 1.1.16-7, I started getting No provider for PaginationConfig! errors.
Was importing PaginationModule in my module declaration and then using in the template:

<pagination [totalItems]="items.length"
     [(ngModel)]="currentPage"
     [itemsPerPage]="perPage"
     previousText="&lsaquo;"
     nextText="&rsaquo;"></pagination>

Worked totally fine for months. No mention of PaginationConfig in the docs or anywhere, for that matter. Downgraded back to 16-3 to get it working.

Versions:
angular: 2.2.3
node: 4.4.2
npm: 3.10.9

Most helpful comment

You must import them odule with forRoot():

import { NgModule } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
import { PaginationModule } from 'ng2-bootstrap';

import { AppRoutingModule } from './app-routing.module';
import { AppComponent } from './app.component';

@NgModule({
  imports: [
    AppRoutingModule,
    BrowserModule,
    PaginationModule.forRoot()
  ],
  declarations: [
    AppComponent
  ],
  bootstrap: [ AppComponent ]
})
export class AppModule {}

All 2 comments

You must import them odule with forRoot():

import { NgModule } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
import { PaginationModule } from 'ng2-bootstrap';

import { AppRoutingModule } from './app-routing.module';
import { AppComponent } from './app.component';

@NgModule({
  imports: [
    AppRoutingModule,
    BrowserModule,
    PaginationModule.forRoot()
  ],
  declarations: [
    AppComponent
  ],
  bootstrap: [ AppComponent ]
})
export class AppModule {}

Great! Thank you.

PaginationModule.forRoot() - Fixed my issue.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

pgeyman picture pgeyman  路  3Comments

RolfVeinoeSorensen picture RolfVeinoeSorensen  路  3Comments

webdev48 picture webdev48  路  3Comments

haisaco picture haisaco  路  3Comments

Scooviese picture Scooviese  路  3Comments