2

在飞镖中,我必须使自定义元素与 main() 函数进行通信。正如 Dart-polymer-example ( https://github.com/sethladd/dart-polymer-dart-examples/blob/master/web/custom_element_with_custom_attribute_binding/index.html )中的一个示例所指出的,目前绑定不起作用.

<template id="tmpl" bind>
  <my-element value="{{value}}" id="test"></my-element>

  <!-- This should be updating, but it's not updating -->
  <!-- See http://code.google.com/p/dart/issues/detail?id=12440 -->
  <p>The model's value is {{value}}</p>
</template>

我尝试了几种替代方式,例如“query(“#test”).attributes [“value”]”,它们不起作用。有没有其他方法可以尝试?

谢谢!

4

1 回答 1

2

是的,我有一个非常相似的问题!您可以查询 DOM,然后获取 xtag 属性以获取底层的 Polymer 对象。所以这个例子是:

query("#test").xtag.value

有关更多详细信息,请参阅文档:

https://www.dartlang.org/articles/web-ui/spec.html#retrieval

于 2013-10-24T12:52:00.317 回答