import {Component} from '@angular/core';
import {IonicPage, NavController, NavParams, ViewController} from 'ionic-angular';

@Component({
    selector: 'page-approvals',
    templateUrl: 'approvals.html',
})
export class ApprovalsPage {

    chooseList = [];
    listApprovalsVO;

    constructor(public navCtrl: NavController, public navParams: NavParams,
                private viewCtrl: ViewController) {
        this.listApprovalsVO = this.navParams.get("listApprovalsVO");
        this.listApprovalsVO.forEach(e => {
            e.checked = e.selectionState === "1";
        })
    }

    ionViewDidLoad() {
        console.log('ionViewDidLoad ApprovalsPage');
    }

    dismiss() {
        this.viewCtrl.dismiss(this.chooseList);
    }

    cancel() {
        this.viewCtrl.dismiss();
    }

}
