title: Cannot set property 'age' of undefined
body: <p>this is my model class and i am trying to set the value in my component but i am getting error that "Cannot set property 'age' of undefined"....</p>
  
  <p>frst.model.ts</p>
  
  <pre><code> import { Component } from '@angular/core';
  
  
      export interface mydata
      {
      name :string;
      age:string;
      data: string;
      }
  </code></pre>
  
  <p>fsrt-Component.ts</p>
  
  <pre><code>import { Component,Output,Input,OnInit, } from '@angular/core';
  import { mydata } from './frst.model';
  @Component({
    selector: 'my-Component',
    template: `
    &lt;div&gt;&lt;h1&gt;hello&lt;/h1&gt;&lt;/div&gt;
    `,
  })
  export class MyComponent  {
   @Input() nputmydata:mydata;
   @Output() outputmydata:mydata;
   PassData:mydata;
  
   constructor()
   {
      this.PassData.age='my name';
      this.PassData.data ='hello';
      this.PassData.name='rajeev';
      this._senddata(this.PassData);
   }
  
  
  
   private _senddata(PassData:mydata)
   {
  
  console.log(PassData);
  
   }
  }
  </code></pre>