import { Component } from '@angular/core';
import { IonicPage, NavController, NavParams,ViewController,MenuController } from 'ionic-angular';
import { dataService } from "../../providers/common.service";
import { TranslateService } from '@ngx-translate/core';
import { Storage } from "@ionic/storage";

@IonicPage()
@Component({
  selector: 'page-ratecard',
  templateUrl: 'ratecard.html',
})
export class RatecardPage {
  rates:any;
  lang: string = 'en';

  constructor(public navCtrl: NavController, public navParams: NavParams, public viewCtrl: ViewController, private data: dataService, private translate: TranslateService, private storage: Storage, private menu:MenuController) {
    this.rates = this.data.getrateData()
    console.log(this.rates)
  }

  ionViewDidEnter(){
    this.menu.swipeEnable(false)
    this.storage.get('lang').then(lang => {
      if (lang != null) {
        this.translate.use(lang)
        this.lang = lang;
      }
      else {
        this.translate.use('en')
      }
    })
  }
  
  dismiss()
  {
    this.viewCtrl.dismiss();
  }

  ionViewWillLeave() {
    this.menu.swipeEnable(true)
  }

}
