Rename pagerService factory to pagerFactory.

This commit is contained in:
CJ Cenizal 2017-02-06 11:29:36 -08:00
parent 10dbff66cc
commit 6eeeab6833
6 changed files with 18 additions and 18 deletions

View file

@ -10,7 +10,7 @@ export function DashboardListingController(
confirmModal,
kbnUrl,
Notifier,
pagerService,
pagerFactory,
Private,
timefilter
) {
@ -62,7 +62,7 @@ export function DashboardListingController(
this.pageOfItems = [];
this.filter = '';
this.pager = pagerService.create(this.items.length, 20, 1);
this.pager = pagerFactory.create(this.items.length, 20, 1);
/**
* Boolean that keeps track of whether hits are sorted ascending (true)

View file

@ -9,7 +9,7 @@ export function VisualizeListingController(
confirmModal,
kbnUrl,
Notifier,
pagerService,
pagerFactory,
Private,
timefilter
) {
@ -63,7 +63,7 @@ export function VisualizeListingController(
this.pageOfItems = [];
this.filter = '';
this.pager = pagerService.create(this.items.length, 20, 1);
this.pager = pagerFactory.create(this.items.length, 20, 1);
/**
* Remember sort direction per property.

View file

@ -1 +1 @@
import './pager_service.factory';
import './pager_factory';

View file

@ -2,7 +2,7 @@ function clamp(val, min, max) {
return Math.min(Math.max(min, val), max);
}
export class PagerService {
export class Pager {
constructor(totalItems, pageSize, startingPage) {
this.currentPage = startingPage;
this.totalItems = totalItems;

View file

@ -0,0 +1,12 @@
import uiModules from 'ui/modules';
import { Pager } from './pager';
const app = uiModules.get('kibana');
app.factory('pagerFactory', () => {
return {
create(...args) {
return new Pager(...args);
}
};
});

View file

@ -1,12 +0,0 @@
import uiModules from 'ui/modules';
import { PagerService } from './pager_service';
const app = uiModules.get('kibana');
app.factory('pagerService', () => {
return {
create(...args) {
return new PagerService(...args);
}
};
});