title: How to use a global variable to enable or disable a button in Angular template driven forms?
body: <pre><code>&lt;a #globalVar&gt;
  
  &lt;input [(ngModel)] = "newTitle"
              #newBlogTitle_l = "ngModel" &gt;
  
  &lt;div *ngIf = 'newBlogTitle_l.value === "" ' &gt;
    globalVar.value = false
  &lt;/div&gt;
  
  &lt;button (click) = "onSave()"   [disabled] = "globalVar" &gt; Save &lt;/button&gt;
  </code></pre>
  
  <p>If there is nothing in the input box, I expect the button to remain enabled.
  What's the way to achieve that?</p>
  
  <p>(This is just for learning purpose.)</p>