Can someone help me understand why my simple submit method is printing Console.log(11) before Console.log(1)? I'm confused about the order of execution.
submit(value) {
this.secServise.getUserById(this.currentUser.mgId).subscribe( uAddrs => {
this.tempUser = uAddrs;
console.log(1);
});
if (value[this.keyPwd] !== value[this.keyCPwd]) {
this.messageService.add({
severity: 'error',
summary: 'Password and Confirm Password should match',
detail: ''
});
} else {
console.log(11);
}
}