Angular2 this is null in component
问题 I'm expecting some weird situations where "this" is null inside a component. SO far, I saw it in two situations: 1) When the promise is rejected: if (this.valForm.valid) { this.userService.login(value).then(result => { if(result.success){ this.toasterService.pop("success", "Exito", "Inicio de session correcto"); this.sessionService.setUser(result.data); this.router.navigateByUrl('home'); } else{ this.error = result.code; } },function(error){ console.log("ERROR: " + error); this.error = "ERROR