I have a service ->
subject = new Subject<any>();
constructor (){
this.subject.next('hello');
}
getsubject():Observable<any>{
return this.subject.asObservable();
}
and component ->
name:string;
subscription : Subscription;
constructor(private serv:SService) {
this.subscription=this.serv.getsubject().subscribe(message=>{console.log('hello');});
}
as you can see, i'm passing hello message from service to subscribers, but in component subscriber is not getting that value, even it's not logging any word.
plunker example