Hello,
I have 2 questions regarding ionic 3.
-
In my ionic3 page I declare a variable called ‘test’ whict cannot be access in actionOnClick function . Does anyone know way? What should I do so that ‘test’ in accessible anywere in FUNCTION_TEST function?
-
Is there a way to make possible the variables exchange between HomePage and FUNCTION_TEST?
Bellow is my ionic3 code.
import { Component,ViewChild } from '@angular/core';
import { NavController } from 'ionic-angular';
import {Content} from 'ionic-angular';
@Component({
selector: 'page-home',
templateUrl: 'home.html'
})
export class HomePage {
@ViewChild(Content) content:Content;
test:string="text 1";
constructor(public navCtrl: NavController) {
}
ionViewDidEnter(){
this.FUNCTION_TEST();
}
FUNCTION_TEST(){
var x=1;
function actionOnClick(){
alert("text="+this.test);
}
}
}
Is it possible that my problem have to do with javascript and not with ionic?
Thanks a lot for your help!