title: Use boolean variable in several components
body: <p>how can I use a boolean variable initialized in a component in other components ?
  Let me explain :
  I have a boolean variable 'flash' that I initialize in my component 'chat-threads'.</p>
  
  <pre><code>&lt;div class="flash-signal"&gt;
    Signal visuel :
    &lt;input type="radio" name="flashsignal" id="flashsignal1" checked="checked" (click)="flashSignal()"&gt;
    &lt;label for="flashsignal1"&gt;Oui&lt;/label&gt;
    &lt;input type="radio" name="flashsignal" id="flashsignal2" (click)="notFlashSignal()"&gt;
    &lt;label for="flashsignal2"&gt;Non&lt;/label&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>Other code : </p>
  
  <pre><code>export class ChatThreadsComponent implements OnInit {
  
  flash = true;
  
  constructor(public threadsService: ThreadsService,
            public messagesService: MessagesService,
            public boxService: BoxService) {
    this.threads = threadsService.orderedThreads;
  }
  
  ngOnInit(): void {
     this.flash = true;
  }
  
  notFlashSignal(): void {
    this.flash = false;
  }
  
  flashSignal(): void {
      this.flash = true;
  }
  }
  </code></pre>
  
  <p>I would like to be able to read the value of this variable in another component 'chat-window' in order to be able to display a visual signal or not.</p>
  
  <pre><code>&lt;div [ngClass]="{'notification-message-unread' : !box.thread.lastMessage.isRead &amp;&amp; flash}"&gt;
  </code></pre>
  
  <p>Do I have to implement this variable in my component?</p>
  
  <p>EDIT : </p>
  
  <pre><code>export class Box {
  id: string;
  thread: Thread;
  discussion: Observable&lt;Message[]&gt;;
  flash: boolean;
  
  constructor(id?: string,
              thread?: Thread,
              messages?: Observable&lt;Message[]&gt;,
              flash?: boolean
  ) {
      this.id = id || uuid();
      this.thread = thread || null;
      this.discussion = messages;
      this.flash = flash || true;
  }
  </code></pre>
  
  <p>}</p>
  
  <p>Component : </p>
  
  <pre><code>&lt;div [ngClass]="{'notification-message-unread' : !box.thread.lastMessage.isRead &amp;&amp; !box.flash}"&gt;
  </code></pre>