Get input in Angular

Published 4/6/2020 by Christian

To atrive 2-way binding i Angular, declare a var in the component.ts file:

public customerName: string;

And bind to it the .html file:

<input [(ngModel)]="customerName" [ngModelOptions]="{standalone: true}">