Q:

angular2 subject not subscribing the change

I've two components and a shared service which is shared by the two components.
shared.service.ts
// ..... top level codes are skipped

private pickAnalysisForBubble = new Subject<any>();

  analysisForBubble$ = this.pickAnalysisForBubble.asObservable();

  mapToggleToPointOrBubble(value) {
    this.pickAnalysisForBubble.next(value);
  }

utility.component.ts
in view (utility.component.html), there are two radio button and one is pre-selected:
<input type="radio" name="rdbBubblePoint" class="rdbBubblePoint" value="Point" (change)="changeToPoint($event)"> Point<br>
<input type="radio" name="rdbBubblePoint" class="rdbBubblePoint" value="Bubble" (change)="changeToPoint($event)" checked="checked"> Bubble<br>

in component (utility.component.ts), there is a method to grab the click event: (I've imported the shared.service and added this as a provider.)
changeToPoint(event){
    # analysisInteraction is the shared service constructor
    this.analysisInteraction.mapToggleToPointOrBubble(event.target.value);
}

map.component.ts
I've imported the shared.service and added a constructor. Then in ngOnInit tried to subscribe the change, but this is not working.
# analysisInteraction is the shared service constructor
this.analysisInteraction.analysisForBubble$.subscribe(
        data => {
          this.DrawType = data;
          console.log("Drawtype fixed");
      });

I'm using subject to detect the change based on this tutorial. What I'm doing wrong?

A:

I guess that you don't share the same instance of the service. Do you specify the corresponding provider when bootstrapping your application or within the main component:
bootstrap(AppComponent, [ SharedService ]);

or
@Component({
  (...)
  providers: [ SharedService ]
})
export class AppComponent {
  (...)
}

If you specify it within providers attributes of sub-components, you aren't sure to share the same instance...
Edit
Because of hierarchical injectors, each component will have its own instance and not share the same one. Thus, the shared service should be added as a provider in main Component. Also, thee shared service should not be included in the provider of sub-components. 

