Access variables declared a component from a RxJS subscribe() function
问题 I am able to use this.variable to access variables in any part of the component, except inside RxJS functions like subscribe() or catch() . In the example below, I want to print a message after running a process: import {Component, View} from 'angular2/core'; @Component({ selector: 'navigator' }) @View({ template: './app.component.html', styles: ['./app.component.css'] }) export class AppComponent { message: string; constructor() { this.message = 'success'; } doSomething() { runTheProcess()