title: Pass data from HTML page to typescript file
body: <p>I have a ngForm for singup page. I have tried passing the data to the .ts file but failed to print them on console.</p>
  
  <p>Here's my code:</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;div class="column" style="padding: 7.5%"&gt;
  &lt;form #instituteForm="ngForm" (ngSubmit)="instituteLogin(instituteForm)"&gt;
      &lt;div class="form-group"&gt;
          &lt;label&gt; Full Name &lt;/label&gt;
          &lt;input 
              type="text" 
              ng-maxlength="10" 
              hint="Full Name" 
              name="patient" 
              id="name" 
              class="form-control"
              [(ngModel)]="institute.patient"&gt;
          &lt;label&gt; Phone Number &lt;/label&gt;
          &lt;input 
              type="number" 
              hint="phone" 
              name="phoneno" 
              id="phone" 
              maxlength="10" 
              minlength="10" 
              class="form-control" 
              [(ngModel)]="institute.phoneno"&gt;
          &lt;label&gt; Aadhar Number &lt;/label&gt;
          &lt;input 
              type="number" 
              hint="aadhar" 
              id="aadhar" 
              name="aadhar" 
              maxlength="16" 
              minlength="16"
              class="form-control" 
              [(ngModel)]="institute.aadhar"&gt;
          &lt;br&gt;&lt;br&gt;
      &lt;/div&gt;
      &lt;button id="signup" class="btn btn-primary" type="submit"&gt;Signup&lt;/button&gt;
  &lt;/form&gt;
  &lt;/div&gt;</code></pre>
  </div>
  </div>
  </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-js lang-js prettyprint-override"><code>institute = {
      patient: '',
      phoneno: '',
      aadhar: '' 
  };
  
  instituteLogin(instForm: NgForm) {
      console.log("Entered new patient");
      console.log(instForm.value);
  }</code></pre>
  </div>
  </div>
  </p>