title: type 'X' is not assignable to type 'Y' in angular 4
body: <p>I am sorry for asking this question ,but I need someone's help to fix it .</p>
  
  <p>What I trying is I have a model class in my Angular 4 app,I want to assign the type to a property in component but it shows the error as </p>
  
  <p>error :</p>
  
  <pre><code>[ts]
  Type '{ gender: null; mTitle: null; mFName: null; mLName: null; mEmail: null; mPassword: null; mDOB: Da...' is not assignable to type 'User'.
    Types of property 'mDOB' are incompatible.
      Type 'DateConstructor' is not assignable to type 'Date'.
        Property 'toDateString' is missing in type 'DateConstructor'.
  (property) CreateaccountComponent.mUser: User
  </code></pre>
  
  <p>User.ts (model class)</p>
  
  <pre><code>export class User {
      gender :string;
      mTitle: string;
      mFName: string;
      mLName: string;
      mEmail: string;
      mPassword: string;
      mDOB: Date;
      mNewsLetter: string;
      mSpecialOffer: string;
  }
  </code></pre>
  
  <p>component </p>
  
  <pre><code>import { User } from '../../User';
  
  export class CreateaccountComponent implements OnInit {
  
    mUser: User = {
      gender: null,
      mTitle: null,
      mFName: null,
      mLName: null,
      mEmail: null,
      mPassword: null,
      mDOB: Date,
      mNewsLetter: null,
      mSpecialOffer: null,
    };
  
    constructor(private CartdataService: CartdataService, private router: Router, private http: HttpClient, ) {
      this.router.events.subscribe(() =&gt; window.scrollTo(0, 0));
    }
  
    ngOnInit() { }
    submitForm(userForm: NgForm): void {
    }
  }
  </code></pre>
  
  <p>here mUser is underlined as red and showing the above error .</p>
  
  <p>can anyone help me to fix this issue .</p>