1

我在访问中继器内的父范围时遇到问题。

以下代码有效:

<polymer-element name="x-playground" extends="div" attributes="children parent">
  <template>
    {{parent}}
    <template repeat="{{children}}">
      {{}}  
    </template>
  </template>

  <script type="application/dart">
    import 'package:polymer/polymer.dart';
    @CustomTag("x-playground")
    class PlaygroundView extends PolymerElement with ObservableMixin {
      @observable List children;
      @observable String parent;
    }
  </script>
</polymer-element>

但是,如果我将其替换为以下内容:

    <template repeat="{{children}}">
      {{parent}}
    </template>

它抛出variable not found: parent in 770699111

有没有办法访问父范围?

4

1 回答 1

2

This is bug https://code.google.com/p/dart/issues/detail?id=12742. Please star the issue to be notified when it's fixed. Thanks for the report!

于 2013-08-29T09:22:20.197 回答