title: anguar passing value from input to model
body: <p>I am making a put request. How can i pass  value from input  form  to my model to pass value that i am filling up - before send form. everything what i have tried it had been thrown errors.</p>
  <p>my model .ts file</p>
  <pre><code> export class Uniticket {
            pk?: string;
            sk?: string;
            PK?: string;
            SK?: string;
            ticketid?: number;
            createdate?: Date;
            status?: string;
            interactionid?: string;
            subject?: string;
            body?: string;
            user?: string;
            entitytype?: string;
            lastupdate?: Date;
            lastupdateuser?: string;
          }
  </code></pre>
  <p>my html :</p>
  <pre><code> &lt;form #userPost=&quot;ngForm&quot; (ngSubmit)=&quot;onSubmit()&quot;&gt;
        &lt;mat-form-field appearance=&quot;legacy&quot;&gt;
          &lt;input
            matInput
            type=&quot;text&quot;
            name=&quot;ticketid&quot;
            id=&quot;ticketid&quot;
            [(ngModel)]=&quot;ticketid&quot;
          /&gt;
          &lt;mat-icon *matSuffix&gt;how_to_reg&lt;/mat-icon&gt;
        &lt;/mat-form-field&gt;
  
        &lt;mat-form-field appearance=&quot;legacy&quot;&gt;
          &lt;input
            matInput
            type=&quot;text&quot;
            name=&quot;createdate&quot;
            id=&quot;createdate&quot;
            [(ngModel)]=&quot;createdate&quot;
          /&gt;
  &lt;mat-icon matSuffix&gt;calendar_today&lt;/mat-icon&gt;
        &lt;/mat-form-field&gt;
  </code></pre>
  <p>my type script component :</p>
  <pre><code>   export class TicketsFormComponent implements OnInit {
    ticketid: number = 0;
    createdate: string = '';
    interactionid: string = '';
    subject: string = '';
    body: string = '';
    user: string = '';
  
    constructor(private service: TicketsService) {}
    ngOnInit() {}
    public addTicket() {
      let resp = this.service.addTicket();
      resp.subscribe((report) =&gt; {
        console.log('report', report);
      });
    }
  
    onSubmit() {
      console.log(this);
      this.addTicket();
    }
  }
  </code></pre>
  <p>thank you in advance</p>