import { Component } from '@angular/core';
import { IonicPage, NavController, NavParams } from 'ionic-angular';
import { Myservice } from "../../providers/myservice";
import { dataService } from "../../providers/common.service";

@IonicPage()
@Component({
  selector: 'page-uploaddoc',
  templateUrl: 'uploaddoc.html',
})
export class UploaddocPage {
  docs:any;

  constructor(public navCtrl: NavController, public navParams: NavParams, private myservice: Myservice, private comService:dataService) {
  }

  ionViewDidEnter(){
    this.myservice.load_post({},'getAllDocument').subscribe(resp=>{
      if(resp.status == 'success'){
        this.docs = resp.data
      }
    })
  }

  uploadDoc(data){
    this.comService.setdocData(data);
    this.myservice.show_loader()
    this.navCtrl.push("DocupdatePage", { title: data.document_type});
  }

}
