title: TypeScript Cannot read property of undefined - Angular 7
body: <p>i have this email model:</p>
  <pre><code>export class Email{
      to: Array&lt;
          {
              email: string
              name: string
          }
      &gt;
      from: {
          email: string
          name: string
      }
      cc: Array&lt;
          {
              email: string
              name: string
          }
      &gt;
      bcc: Array&lt;
          {
              email: string
              name: string
          }
      &gt;
      subject: string
      body: string
      type: string
  }
  </code></pre>
  <p>Then I import the email model and declare it in the class like this:</p>
  <pre><code>import { Email } from '@/models/email';
  
  export class BuilderJobComponent implements OnInit {
      emailJobData: Email
  </code></pre>
  <p>Later on, inside a class method I try to set a value but I get undefined. What am I not understanding about this?</p>
  <blockquote>
  <p>Cannot read property 'from' of undefined</p>
  </blockquote>
  <pre><code>this.emailJobData.from.email = email
  this.emailJobData.from.name  = name
  
  // set the To address
  if( Recipient ){
      this.emailJobData.to.push({ email: Recipient, name: '' })
  }
  </code></pre>