title: Angular2 forcing reload ngIf (or alternative in this case)
body: <p>This a bootstrap twitter, <code>button</code> this control to data toggle collapse</p>
  
  <pre><code>&lt;button class="btn btn-primary" ....
                 aria-expanded="false"&gt;
  </code></pre>
  
  <p>this a bootstrap twitter inside of <code>nav-tabs</code>, this show on button click</p>
  
  <pre class="lang-html prettyprint-override"><code>&lt;div *ngIf="ifActivoControl('1' + contadorObjet.name)"
  
        class="embed-responsive embed-responsive-16by9"&gt;
      &lt;iframe class="embed-responsive-item"
          src="//www.youtube.com/v/YX....."&gt;
      &lt;/iframe&gt;
  &lt;/div&gt;
  </code></pre>
  
  
  
  <p>When angular2 render for the first time this function <code>ifActivoControl('1' + contadorObjet.name)</code> return false. </p>
  
  <p><em>This function is to test the not taken seriously</em></p>
  
  <pre><code>ifActivoControl(test: any): boolean{
  
        let booleanStr = document.getElementById(test).getAttribute('aria-expanded');
        let bool: boolean = false;
  
        if(booleanStr === 'false'){
          bool = false;
        }else{
          bool = true;
        }
  
      return bool;
      }
  </code></pre>
  
  <p>Return false because <code>aria-expanded="false"</code> but when this switch to true <code>aria-expanded="true"</code>, how can I do, <code>ngIf</code> to check again.</p>
  
  <p>This may not be the best way to do, but it is, as I have tried I hope you understand what I mean.</p>
  
  <hr>
  
  <p><strong>UPDATE:</strong></p>
  
  <p>I solved after reading this <a href="https://stackoverflow.com/questions/34827334/triggering-angular2-change-detection-manually/34829089#34829089">answer</a> by Marcos Rajcok and reading this,</p>
  
  <p><a href="https://angular.io/docs/ts/latest/api/core/ChangeDetectorRef-class.html#!#detach" rel="nofollow noreferrer">https://angular.io/docs/ts/latest/api/core/ChangeDetectorRef-class.html#!#detach</a></p>
  
  <p>but I do not know if this is the best way. The first tests I do, it works as expected</p>