fix(angular): module exports

This commit is contained in:
Manu Mtz.-Almeida
2018-03-30 21:52:29 +02:00
parent b35f95a4d8
commit cece447092
40 changed files with 657 additions and 996 deletions

View File

@@ -0,0 +1,13 @@
export { AngularDelegate } from './angular-delegate';
export { ActionSheetController } from './action-sheet-controller';
export { AlertController } from './alert-controller';
export { Events } from './events';
export { LoadingController } from './loading-controller';
export { MenuController } from './menu-controller';
export { PickerController } from './picker-controller';
export { ModalController } from './modal-controller';
export { Platform } from './platform';
export { PopoverController } from './popover-controller';
export { ToastController } from './toast-controller';
export { NavController } from './nav-controller';

View File

@@ -0,0 +1,34 @@
import { Injectable } from '@angular/core';
@Injectable()
export class NavController {
private direction = 0;
private goBack = false;
private stack: string[] = [];
setGoback() {
this.goBack = true;
}
consumeDirection() {
if (this.direction === 0) {
const index = this.stack.indexOf(document.location.href);
if (index === -1) {
this.stack.push(document.location.href);
this.direction = 1;
} else if (index < this.stack.length - 1) {
this.stack = this.stack.slice(0, index + 1);
this.direction = -1;
}
}
const direction = this.goBack
? -1
: this.direction;
this.goBack = false;
this.direction = 0;
return direction;
}
}