Databinding – Passing and Using Data with Event Binding in Angular

server.component.ts

import {Component, OnInit} from '@angular/core';

@Component({
  selector: 'app-server',
  templateUrl: './server.component.html',
  styleUrls: ['./server.component.css']
})
export class ServerComponent implements OnInit {

  public serverName: String = '';

  constructor() {
  }

  ngOnInit() {
  }

  onUpdateServerName(event: Event) {
    this.serverName = (<HTMLInputElement> event.target).value;
  }
}

server.component.html

<label>Server Name</label>
<br>
<input type="text" (input)="onUpdateServerName($event)">
<p>{{serverName}}</p>

References
https://github.com/mhdr/AngularSamples/tree/master/007/my-app