【问题标题】:Accessing Parent Context in Polymer.dart在 Polymer.dart 中访问父上下文
【发布时间】:2013-08-31 12:14:04
【问题描述】:

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

以下代码有效:

<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

有没有办法访问父作用域?

【问题讨论】:

标签: dart dart-webui polymer


【解决方案1】:

这是错误https://code.google.com/p/dart/issues/detail?id=12742。请给问题加注星标,以便在问题修复后收到通知。感谢您的报告!

【讨论】:

    猜你喜欢
    • 2014-12-02
    • 2017-07-02
    • 2015-05-06
    • 2013-04-08
    • 1970-01-01
    • 2017-03-29
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多