1
I need to export the language variable of a ts to another, however, the variable (language) that is being exported does not present the value that I want to export.
I tried to put the export in some line inside the same part as the variable, also I tried to create a new variable to be exported that copies the value of the variable I want to export.
export class IdiomasPage implements OnInit {
idioma = `br`;
constructor() {
}
ngOnInit() {
}
idiomabr(){
this.idioma = `br`
console.log(this.idioma)
}
idiomaus(){
this.idioma = `us`
console.log(this.idioma)
}
}
export var idioma;
I need the language variable in export to have the same value as the language variable in the functions.
It won’t work, Fabio. First language is a property of the Languagespage class, it is not defined in the scope that export has access to, so it must be returning
undefined
. You should return the class and create an instance of it where you need to call this value,.– Phiter
obg, I’ll try to apply
– Fábio Fernandes Costa