In my angular 2 app i got method:
myMethod(component: any): void {
let a = console.log('start');
if (this._something) {
// Here i got custom modal window
this._service.callModalWindow('message').subscribe(result => {
if (result === 'Confirm') {
let b = console.log('confirm);
}
}
}
let c = console.log('finish');
}
The problem is: The way this method call console.log is not what i want, i want to get first console.log('first'), then after i got my modal confirmed get console.log('confirm'), and then get the final console.log('finish');
Now i have this situation, method calls variable a, then c, then b when i confirm modal.
Does anyone have any ideas how i can work around this situation?
let cright afterlet b?!console.logdoes not return anything.