Getting data from service to another component

from component A where i have list of All users, when i click on EDIT I send data with user ID to service and from service to component B
In service.ts I create

  selectedUser = new Subject<any>();

From component A;

And in component B

ngOnInit() {
  user => {
    this.user = user;
  data => {
    if (this.user === undefined) {
      this.addNewUserState = true;
    } else {
      this.addNewUserState = false;

On first DETAIL click I don’t get data, only on second click
here is preview

Source: New feed
Source Url Getting data from service to another component