Quantcast
Channel: Ionic Framework - Ionic Forum
Viewing all articles
Browse latest Browse all 49295

How to set global variable for all function

$
0
0

@dhy wrote:

I have a problem where the variable I use doesn’t apply to all functions,
when I put a variable in one function I can’t take the value in the other function

thismy.ts


export class BooktravelPage {
  public kursi_dipilih:any;
  public jumlah_kursi_dipilih: any;
  public kursis_dipilih: any;
  public list_kursi_dipesan:any;
  public kursi:any;

  constructor(public navCtrl: NavController, public navParams: NavParams, private storage: Storage, public authService: AuthServiceProvider) {
  }

  ionViewWillEnter(){
    this.kursi_dipilih;
    this.jumlah_kursi_dipilih = 0;
    this.kursis_dipilih = new Array();
    this.list_kursi_dipesan;
    //$scope.jumlah_kursi_dipilih	= 0;
    this.kursis_dipilih.length = 0;
    this.kursi = '';
}

pilihKursi(){
          console.log(this.jumlah_kursi_dipilih);
}

Posts: 2

Participants: 2

Read full topic


Viewing all articles
Browse latest Browse all 49295

Trending Articles