auto-binding-dart não está funcionando, falha com erro de estado incorreto
Estou tentando executar este exemplo básico de auto-binding-dardofonte de dardo de ligação automática. Mas falha com
Quebrando na exceção: Estado incorreto: o modelo deve ser limpo antes que um novo bindingDelegate possa ser atribuído
Estou fazendo isso usando o modelo stageapp polymerapp. index.html
<html>
<head>
<link rel="import" href="../lib/main_app.html">
<link rel="stylesheet" href="styles.css">
<script type="application/dart">export 'package:polymer/init.dart';</script>
</head>
<body unresolved>
<main-app></main-app>
</body>
</html>
main_app.html
<link rel="import" href="../../packages/polymer/polymer.html">
<polymer-element name="main-app">
<template id="my-template" is="auto-binding-dart">
<style>
:host {
display: block;
}
</style>
<div>Say something: <input value="{{value}}"></div>
<div>You said: {{value}}</div>
<button on-tap="{{buttonTap}}">Tap me!</button>
</template>
<script type="application/dart" src="main_app.dart"></script>
</polymer-element>
main_app.dart
import 'dart:html';
import 'package:polymer/polymer.dart';
@CustomTag('main-app')
class MainApp extends PolymerElement {
/// Constructor used to create instance of MainApp.
MainApp.created() : super.created();
ready(){
super.ready();
var template = document.querySelector('#my-template');
template.model = new MyModel();
}
}
class MyModel {
String value = 'something';
buttonTap() => window.console.info('tap!');
}