Posts

Showing posts with the label webui

Two-way data binding with Web UI custom elements and models

Image
Preface This could very well be my last Web UI post! The Dart team announced they started on polymer.dart , a port of the Polymer project to Dart. Polymer.dart is the next evolution of Web UI. Luckily, the concepts are mostly the same and the syntax is mostly the same, because Web UI is also an implementation of the Web Components. So why am I still writing about Web UI? Lots of people have asked about two-way data binding between a component and a model, so I wanted to have a record of this functionality. Also, what's described below isn't too different than how polymer.dart works (and we'll cover it in a future post). I look forward to the glorious new world of coordinated polyfills and new custom elements. Go go polymer.dart and the Polymer project! Intro The Dart class that backs a custom element can itself also take part in two-way data binding. This post explores how to bind a model object to a web component property. If a model's field changes, the cus...