title: ERROR TypeError: undefined is not an object
body: <p>In my NativeScript with Angular project, I'm just trying to simply use an object to gather information on a user. Whenever I do this, I get an error that says <code>ERROR TypeError: undefined is not an object (evaluating '_co.user.username')</code>. I tried to recreate this in the NativeScript Playground but it wouldn't recognize my model.</p>
  
  <p>So, here's my model:</p>
  
  <pre><code>export interface User {
      id: number,
      username: string,
      password: string,
      firstName: string,
      lastName: string,
      permissions: string,
      year: number,
      basketball: boolean,
      dodgeball: boolean,
      football: boolean,
      soccer: boolean,
      softball: boolean,
      volleyball: boolean,
      teamID: number
  }
  </code></pre>
  
  <p>Here's my .ts component:</p>
  
  <pre><code>export class SignUpComponent implements OnInit {
  
      public user: User;
  
      constructor(private router: Router) { }
  
      ngOnInit(): void { }
  
      nextSignUp(): void {
          alert(this.user.username);
          this.router.navigate(['/signUpInfo']);
      }
  }
  </code></pre>
  
  <p>and then here's my .html file where I use my ngModel:</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;ActionBar title="Sign Up" class="action-bar"&gt;&lt;/ActionBar&gt;
  &lt;GridLayout class="pageBackground"&gt;
   &lt;ScrollView&gt;
    &lt;StackLayout class="main-container"&gt;
     &lt;TextField style="margin-top: 3%;" class="form-control" hint=" Email Address" keyboardType="email" returnKeyType="done" autocorrect="false"
      autocapitalizationType="none" [(ngModel)]="user.username"&gt;&lt;/TextField&gt;
     &lt;Button class="btn btn-primary btn-rounded-sm" style="width: 90%; height: 7%; padding: 0px; margin-top: 77%; background-color: black; color: white; vertical-align: bottom;"
      text="Next" (tap)=nextSignUp()&gt;&lt;/Button&gt;
    &lt;/StackLayout&gt;
   &lt;/ScrollView&gt;
  &lt;/GridLayout&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p>I can't understand why I'm getting this error or how to fix it. Any help would be greatly appreciated.</p>