title: Bind object to input field Angular
body: <p>I want to bind a Company object from my component to my view. This was easy in AngularJS, but I get an error when I do this in Angular 2. </p>
  
  <p>View</p>
  
  <pre><code>&lt;input type="text" class="form-control" [(ngModel)]="company.name" 
      placeholder="Company Name" required&gt;
  &lt;input type="text" class="form-control" [(ngModel)]="company.address1" 
      placeholder="Address Line 1" id="address1" required&gt;
  &lt;button class="btn btn-primary pull-right next-btn" (click)="show()"&gt;Next&lt;/button&gt;
  </code></pre>
  
  <p>Component:</p>
  
  <pre><code>company: Company;
  
  constructor(
    private router: Router
   ) { }
  
  ngOnInit() { }
  
  show() {
    console.log(this.company);
  }
  </code></pre>
  
  <p>error:</p>
  
  <pre><code>TypeError: Cannot read property 'name' of undefined
  </code></pre>