title: How to change ng-template variable in Angular 5
body: <p>When I try to change a ng-template variable on click inside the template I receive an error(Uncaught Error: Cannot assign to a reference or variable!)</p>
  
  <pre><code>&lt;ng-template let-o="opened" [ngTemplateOutletContext]="{ opened: d === 0 }" [ngTemplateOutlet]="item" #item&gt;
    &lt;div class="columns table-header is-marginless"&gt;
      &lt;button (click)="o = !o"&gt;+&lt;/button&gt;
      &lt;div [hidden]="!o"&gt;Toggle me on button click&lt;/div&gt;
    &lt;/div&gt;
  &lt;/ng-template&gt;
  </code></pre>
  
  <p>So how to access the local 'o' variable in order change it? </p>