Angular two way binding and banana box syntax

myInputProperty: string;
myInputPropertyChange = new EventEmitter<string>();
<my-component [myInputProperty]="propertyToBindTo (myInputPropertyChange)="propertyToBindTo = $event"></my-component>
<my-component [(myInputProperty)]="propertyToBindTo"></my-component>
<input name="checked" [(ngModel)]="propertyToBindTo">
<input name="propertyToBindTo" [ngModel]="propertyToBindTo"  (ngModelChange)="myFunctionWithCustomLogic($event)">




Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

JavaScript Essentials: Often Overlooked Elements of One of The Most Popular Web Development…

Social Authentication with Strapi & Nuxt.js: Getting Started

Unit testing Vuex actions with Jest mocks

The JavaScript guide to LocalStorage vs. SessionStorage

Publish a NodeJS package with GitLab CI

Test Automation Tools:

Kick Start Automation with Cypress (Implement Page Object Model & Generic Functions)

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Adrian Brand

Adrian Brand

More from Medium

Angular Components….

Pure vs Impure pipe Performance

Why Should You Learn Angular?

Conditional styles in Angular templates