MutationObserver をテストするために、Dart ポリマーの例の 1 つを変更しました。それは動作しません!なにか提案を?
これは HTML コードです。
<body>
<ul>
<template id="tmpl" repeat>
<li>{{}}</li>
</template>
</ul>
</body>
これは Dart コードです:
MutationObserver observer = new MutationObserver(_onMutation);
observer.observe(query('#tmpl'), childList: true, subtree: true);
List timestamps = toObservable([]);
query('#tmpl').model = timestamps;
new Timer.periodic(const Duration(seconds: 1), (_) {
timestamps.add(new DateTime.now());
});
_onMutation(List<MutationRecord> mutations, MutationObserver observer) {
print('hello test MutationObserver'); **//there is not any print!!!!!!!!!!!**
}
なぜそれが機能しないのかについて何か考えはありますか?
[注: Web ページの表示は問題ありませんが、問題は MutationObserver に関するものです]
ありがとう!