Posts

Showing posts with the label polymer

Angular and Polymer Data Binding, Together!

Image
Angular and Polymer, sitting in a DOM tree, B-i-n-d-i-n-g. First comes components, Then comes elements, Then comes the interop with the node dot bind. Angular , a super heroic MVC framework, and Polymer , polyfills and enhancements for custom elements built on top of Web Components, can live harmoniously in the same app. This post shows you how to connect Angular-controlled components to Polymer-controlled elements via data binding. And we do it all in Dart . Angular and Polymer I get asked "Should I use Angular or Polymer?" a lot. My answer is, "Yes". That is, both libraries have distinct strengths, and you can use both in the same app. Polymer excels at creating encapsulated custom elements. You can use those custom elements in any web app or web page, regardless if that app is built with Angular, Ember, etc. Angular excels at application engineering, with dependency injection, end-to-end testability, routing, and services. Here are som...

Forms, HTTP servers, and Polymer with Dart

Image
(Update of this old Web UI post . Updated as of Jan 17, 2014 and Dart 1.1.) Dart can be used on the client and the server. This post shows how to: build a form as a custom element bind input fields to a Dart object build a Dart HTTP server handle and parse a form submit For lots more Polymer.dart examples, be sure to check out the Dart Polymer Samples . You can find the code for this post at my Github account. Step 1: Install the packages Open up pubspec.yaml (used by the pub package manager) and add the dependencies for Polymer.dart and http_server. name: parse_form_submit description: A sample Polymer application dependencies: polymer: any http_server: any Source for pubspec.yaml . Step 2: Create the model class This class is for the "business object". It is bound to the form, so we make its fields observable. library models; import 'package:polymer/polymer.dart'; class Person extends Object with Observable { @observable S...

Polymer and Dart: A First Look

Image
In which I try the new polymer.dart, a build.dart file is deleted, and a template springs to life. (This post heavily inspired by Nik Graf's great " Getting started with Polymer.dart " post.) The web is evolving Developers take notice! Coming soon: actual encapsulation, real live data binding, even re-usable components! The Web Components family of specifications is on their way to a browser near you, but the standardizations process is lengthy. Fear not, web engineers are working hard to bring these new capabilities to you today. The Polymer project , a new type of library for the web, is built on top of Web Components, and designed to leverage the evolving web platform on modern browsers. Most importantly, the Polymer project has code that you can use  today  (to be fair, it's pre-alpha, but much of it works if you are brave). The Polymer project is more than just polyfills. Web UI is evolving The Dart project, to more closely align with emerging ...