removed unnecessary factory classes, simplified existing services
This commit is contained in:
parent
2a59014f0b
commit
64a4b68216
15 changed files with 69 additions and 158 deletions
|
@ -1,4 +1,5 @@
|
|||
import { ViewArray } from './view-array';
|
||||
import { Inject } from '../../decorators/inject/inject.decorator';
|
||||
|
||||
|
||||
export class ViewArrayImpl implements ViewArray {
|
||||
|
@ -10,8 +11,9 @@ export class ViewArrayImpl implements ViewArray {
|
|||
public hasHiddenEntries: boolean;
|
||||
private timerRef: any;
|
||||
private currentIndex: number;
|
||||
private additionalCount: number = 20;
|
||||
|
||||
constructor(private interval: any, private additionalCount: number) {
|
||||
constructor(@Inject('$interval') private interval: any) {
|
||||
this.isVisible = false;
|
||||
this.visibleEntries = null;
|
||||
this.hasEntries = false;
|
||||
|
@ -57,6 +59,10 @@ export class ViewArrayImpl implements ViewArray {
|
|||
}
|
||||
}
|
||||
|
||||
public create(): ViewArrayImpl {
|
||||
return new ViewArrayImpl(this.interval);
|
||||
}
|
||||
|
||||
private showAdditionalEntries(): void {
|
||||
var i: number = 0;
|
||||
for (i = this.currentIndex; i < (this.currentIndex + this.additionalCount) && i < this.entries.length; ++i) {
|
||||
|
|
Reference in a new issue