title: Detect variable changes into localStorage angular 8
body: <p>I have this funcion on the component calls navbar:</p>
  
  <pre><code>getAddUsuario(){
  if(window.localStorage.getItem('addUsuario') == 'false'){
    window.localStorage.setItem('addUsuario','true');
  
  }else{
    window.localStorage.setItem('addUsuario','false');      
  }
  return window.localStorage.getItem('addUsuario');
  </code></pre>
  
  <p>So, when i click the variable addUsuario change to false if is true and to true if is false.</p>
  
  <p>The problem is i wqant to detect that changes from another component and pass it into HTML. if is true take a div class and if is false take another div class.</p>
  
  <p>I tried with addEventlistener but doesnt work.</p>
  
  <p>Thanks</p>