title: When instantiating a class in angular, the initialization is missing methods
body: <p>I have the following User class:</p>
  <pre><code>export class User{
      id: number = 0;
      fName: string = &quot;&quot;;
      lName: string = &quot;&quot;;
      
      constructor(){}
      
      fullName() { return this.fName + ' ' + this.lName; }
      
      email() { return this.fname + &quot;@sof.com&quot;}
  }
  </code></pre>
  <p>I am trying to create a form so users can input their information. I want a two-way data binding, so I am creating an instance of the User class in the user-form.component.ts:</p>
  <pre><code>import { Component, OnInit } from '@angular/core';
  import { FormsModule } from '@angular/forms';
  import { User } from '../user';
  
  @Component({
    selector: 'app-user-form',
    templateUrl: './user-form.component.html',
    styleUrls: ['./user-form.component.css']
  })
  export class UserFormComponent implements OnInit {
  
    constructor() { }
  
    usrData: User= {} as User;
  
    ngOnInit(): void {
      this.usrData = {
        id: 123,
        fName: &quot;user&quot;,
        lName: &quot;name&quot;
      }
    }
  }
  
  </code></pre>
  <p>But when I finish instantiating, usrData is underlined in red and gives the following error:</p>
  <blockquote>
  <p>Type '{ id: number; fName: string; lName: string; }' is missing the following properties from type 'User': fullName, email    ts(2739)</p>
  </blockquote>
  <p>What am I doing wrong here?</p>
  <p>Thanks in advance.</p>