title: Angular 2 bind HTML inputs to component variables like in Vue?
body: <p>So I've been struggling with this for a long time...I've been looking into the docs, but there are so many different directives and ways to communicate between components and the DOM, but only a few good examples...</p>
  
  <p>So I'm actually not even sure what I need. Let's say I have a user input in my <strong>tables.component.html</strong> file like this:</p>
  
  <pre><code>&lt;label&gt;Name&lt;/label&gt;
  &lt;input id="customerName" class="form-control" required&gt;
  </code></pre>
  
  <p>Then there is my <strong>tables.component.ts</strong> file which looks like this:</p>
  
  <pre><code>import { Component, OnInit } from '@angular/core';
  import { isLoggedIn } from '../../assets/js/auth.js';
  import { Router } from '@angular/router';
  
  
  @Component({
    selector: 'app-tables',
    templateUrl: './tables.component.html',
    styleUrls: ['./tables.component.css']
  })
  
  export class TablesComponent implements OnInit {
  
    customers = [];
  
    id = ""; // keep outside of object to prevent user changes
    customer_form = {
      name: "",
      job: "",
      address: "",
      birthdate: "",
      email: "",
    }
  
    constructor(private router: Router) { }
  
      ...
  }
  </code></pre>
  
  <p>To make it simple: I want to bind the user input above to the customer_form.name variable in my component. I'm looking for the equivalent of Vue 2.0 models, so that if the user changes the input value, the component value changes aswell. I don't neccessarily have to push the data within a form since we've got the task not to set up any backend...</p>
  
  <p>Anyway, I'm kinda confused. I read the docs, but that made it just worse. One page says I'm supposed to add a controller to the form and add a script to the bottom of the HTML, another one said I have to make a template of the form that should be stored in the component...And then there are so many different directives to bind things. I was assuming you'd want to use ngModel for that, but I couldn't seem to get that working like in the examples I found.</p>
  
  <p>Thanks for any help in advance..</p>