I'm new to angular etc, and I have been playing around with resolve. However, when I want to pass a local boolean I get undefined? i'm trying to understand why. This below is my guard, my service just calls an api and it is passing. I want to pass a boolean to the component that the resolve is attached to, in order to display an error or not.
resolve(): boolean {
let passed: boolean;
let uid: string = window['appdata'].uid;
let tbt: string = window['appdata'].tbt
let lang: string = window['appdata'].apiUserLanguage;
if(uid != null || undefined && tbt != null && undefined){
console.log('Uid is: ' + uid + ' tbt is: ' + tbt);
this.validateEmailService.emailCheck(uid, tbt, lang).subscribe(
data => {
passed = true;
},
err => {
passed = false;
}
);
}
console.log('Passed is: ' + passed);
return passed;
}
}