I'm working on a notification feature on a Angular 5 project. There's a property on header called `notifications` storing number of new notifications for that user.

I want to dynamically update that `notifications` property on header after a call from another component, which means I will decrease it every time a user clicks on 'seen' button. But even though the header component is set to be subscribed at a change on notification service's Subject, the `notifications` value is not changing.

This is a extract from `notification.service.ts`

```js
export class NotificationService {
    notifications: any;
    public notificationChange: Subject<number> = new Subject<number>();

    constructor(private http: HttpClient){

        this.notificationChange.subscribe((value) => {
            this.notificationNumber = value;
        });
    }

    updateNotificationNumber(item: any) {   
        this.notificationChange.next(item);
    }
}

```

On my `notification.component.ts`, there's this function `updateNotificationToSeen` called after a button click (the number sent is hardcoded just for testing purposes. I will eventually make it right after I can see effective changes) that triggers the `updateNotificationNumber` from service.

```js
export class NotificationComponent implements OnInit {
    constructor(private notificationService: NotificationService){}

    updateNotificationToSeen() {
        this.notificationService.updateNotificationNumber(150); 
    }
}

```

This is a extract from `header.component.ts`, which I tried to subscribe the notificationChange on its `constructor`, but it did not work. I also tried the way is listed below, on `ngOnInit` but again, no changes.

```js
export class HeaderComponent implements OnInit {

    notifications: number;

    constructor(public notificationService: NotificationService) {
    }

    ngOnInit(){
         this.notificationService.notificationChange.subscribe(value =>{
            this.notifications = value;
        })
    }

}

```

I've tried a few tutorials but I couldn't figure out why header can't see changes after that property.

I will appreciate any thoughts on a better solution for this.