Advertisement
roynaldoindra

salondetil.ts

Jun 6th, 2017
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import { Component } from '@angular/core';
  2. import { IonicPage, NavController, NavParams } from 'ionic-angular';
  3. import { Reservasi } from '../reservasi/reservasi';
  4. import { RestapiService } from '../../providers/restapi-service';
  5.  
  6. /**
  7.  * Generated class for the Salondetil page.
  8.  *
  9.  * See http://ionicframework.com/docs/components/#navigation for more info
  10.  * on Ionic pages and navigation.
  11.  */
  12. @IonicPage({
  13.   name: 'salondetil'
  14. })
  15.  
  16. @Component({
  17.   selector: 'page-salondetil',
  18.   templateUrl: 'salondetil.html',
  19.  
  20. })
  21. export class Salondetil {
  22.  
  23.   data:any;
  24.  
  25.   constructor(public navCtrl: NavController, public navParams: NavParams, private restapiService: RestapiService) {
  26.  
  27.     this.data = {
  28.         id : this.navParams.get('id')
  29.     };
  30.  
  31.     this.loadData();
  32.   }
  33.  
  34.   ionViewWillEnter(){
  35.       if(this.navParams.get('id') == undefined){
  36.           this.navCtrl.popToRoot();
  37.       }
  38.   }
  39.  
  40.  
  41.   ionViewDidLoad() {
  42.     console.log('ionViewDidLoad Salondetil');
  43.   }
  44.  
  45.   reservasi() {
  46.     this.navCtrl.push(Reservasi);
  47.   }
  48.  
  49.   loadData(){
  50.       this.restapiService.viewSalondetil({id:this.data.id_user}).then(
  51.           (dt) => {
  52.               let result :any = dt;
  53.               this.data = dt;
  54.           },
  55.         () => {
  56.  
  57.           }
  58.       );
  59.   }
  60.  
  61. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement