Skip to Content
Learning TypeScript 2.x - Second Edition
book

Learning TypeScript 2.x - Second Edition

by Remo H. Jansen
April 2018
Beginner content levelBeginner
536 pages
13h 21m
English
Packt Publishing
Content preview from Learning TypeScript 2.x - Second Edition

Data binding

In Angular, we use data binding to coordinate the application's state with the content rendered on screen. Angular supports three kinds of binding, distinguished by the direction of data flow:

Data direction

Syntax

Type

One-way from data source to view target

{{expression}} [target]="expression"

  • Interpolation
  • Property
  • Attribute
  • Class
  • Style

One-way from view target to data source

(target)="statement"

Event

Two-way

[(target)]="expression"

Two-way

Binding types other than interpolation have a target name to the left of the equals sign, surrounded by punctuation ([] and ()).

Please refer to the documentation at https://angular.io/guide/template-syntax to learn more about the data binding syntax. ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Mastering TypeScript - Fourth Edition

Mastering TypeScript - Fourth Edition

Nathan Rozentals
Learning TypeScript

Learning TypeScript

Josh Goldberg
TypeScript for Beginners

TypeScript for Beginners

Bharath Thippireddy

Publisher Resources

ISBN: 9781788391474Supplemental Content