[Solved] Passing data to another component [duplicate]


You can do this by adding a inject a service for both component then put the data in the service so both can find it. Also you can use the @input and the @output directive , but i prefer the service ( In this service both share the varible is ready ) :

import {EventEmitter, Injectable} from '@angular/core';

      @Injectable()
      export class LoadPageService {
          private isReady= false;
          // Event emitter that make event each time the variabe isReady 
           changes
         Updated: EventEmitter <boolean>= new EventEmitter();
        setdata( value) {
          this.isReady = value;
            this.Updated.emit(this.isReady);
        }

          getdata() {
          return this.isReady;
        }

      }

solved Passing data to another component [duplicate]