title: Angular 9 property length - Cannot read property 'length' of undefined
body: <p>I have web application in Angular 9 and TypeScript.
  In html file I want to disable button when length of the string is less than 10.
  My code in html:</p>
  
  <pre><code>&lt;div class="p-2 form-group"&gt;
                &lt;textarea type="text" class="form-control" id="inputCommentBody" placeholder="Text" [(ngModel)]="postCommentModel.body" rows="3"&gt;&lt;/textarea&gt;
              &lt;/div&gt;
  
  &lt;button class="btn btn-primary" (click)="addPostComment(post.id, null)" [disabled]="postCommentModel.body !== undefined || postCommentModel.body.length &lt; 10"&gt;
                Add comment
              &lt;/button&gt;
  </code></pre>
  
  <p>In TypeScript code looks like:</p>
  
  <pre><code>export class UserPageComponent implements OnInit {
    public postCommentModel: any = {};
  </code></pre>
  
  <p>And I get error:</p>
  
  <pre><code>ERROR TypeError: Cannot read property 'length' of undefined
      at UserPageComponent_div_13_Template (user-page.component.html:113)
      at executeTemplate (core.js:12059)
      at refreshView (core.js:11906)
      at refreshDynamicEmbeddedViews (core.js:13283)
      at refreshView (core.js:11929)
      at refreshComponent (core.js:13358)
      at refreshChildComponents (core.js:11635)
      at refreshView (core.js:11958)
      at refreshDynamicEmbeddedViews (core.js:13283)
      at refreshView (core.js:11929)
  </code></pre>