Podczas dynamicznego dodawania elementów polimerowych rzutki, jak uzyskać zmienne obserwowalne na DOM

Próbuję zmienić domyślną aplikację internetową, która korzysta z biblioteki polimerów, tak aby element polimerowy był tworzony i dodawany do DOM z kodu DART, a nie w HTML. Udało mi się dodać element do DOM, ale moja zmienna obserwowalna nie jest aktualizowana w DOM. Wydarzenia są odpalane, a wartości się zmieniają. Mam aktualizację DOM przy użyciu Observable.dirtyCheck (), jednak wydaje się, że jest to kosztowne, więc próbuję dowiedzieć się, jak zaktualizować polimer bez dirtyCheck ().

W skrócie, jak pozbyć się Observable.dirtyCheck () ???

dynamiccreate.dart

library dynamiccreate;

import 'dart:html';
import 'package:polymer/polymer.dart';



main() {
  initPolymer();

  //create click-counter element at runtime from DART, not HTML
  var NewElement = new Element.tag('click-counter');
  NewElement.setAttribute("count", "5");
  //Add to DOM
  querySelector('#sample_container_id').children.add(NewElement);
}

dynamiccreate.html

<!DOCTYPE html>

<html>
  <head>
    <meta charset="utf-8">
    <title>Sample app</title>
    <link rel="stylesheet" href="dynamiccreate.css">

    <!-- import the click-counter -->
    <link rel="import" href="clickcounter.html">
    <!-- <script type="application/dart">export 'package:polymer/init.dart';</script> -->
    <script src="packages/browser/dart.js"></script>
  </head>
  <body>
    <h1>DynamicCreate</h1>

    <p>Hello world from Dart!</p>

    <div id="sample_container_id">
     <!--  <click-counter count="5"></click-counter> -->
    </div>
    <script src="dynamiccreate.dart" type="application/dart"></script>
  </body>
</html>

clickcounter.dart

import 'package:polymer/polymer.dart';

/**
 * A Polymer click counter element.
 */
@CustomTag('click-counter')
class ClickCounter extends PolymerElement {
  @published int count = 0;

  ClickCounter.created() : super.created() {
  }

  //increment gets called when dynamically adding object at runtime
  //But does not update count on DOM
  void increment() {
    count++;
    //Have to add this to update count in DOM
    Observable.dirtyCheck(); //<<<---How do I get rid of this???
  }
}

clickcounter.html

<polymer-element name="click-counter" attributes="count">
  <template>
    <style>
      div {
        font-size: 24pt;
        text-align: center;
        margin-top: 140px;
      }
      button {
        font-size: 24pt;
        margin-bottom: 20px;
      }
    </style>
    <div>
      <button on-click="{{increment}}">Click me</button><br>
      <span>(click count: {{count}})</span>
    </div>
  </template>
  <script type="application/dart" src="clickcounter.dart"></script>
</polymer-element>

questionAnswers(1)

yourAnswerToTheQuestion