I have following problem. I need to return value from REST server. Everything is okey, i am getting what i want, but there is a small problem. Asynchronous is not working and i have no idea why. I will show you my code and result by images.
Code
And result in chrome
Why is it not working as i want to work? Of course, result should have been 1/2 then 3. Thanks for any help
js code
ngOnInit() {
this.error = this.getBlockedText();
}
private getBlockedText(): string {
let customTxt;
this.proxy.core.getUISettings({}).then(res => {
customTxt = res;
console.log('1');
}).catch(err => {
console.log('2');
})
console.log('3');
return customTxt;
}