Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/dart/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/security/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
使用polymer.dart在dart中进行双向数据绑定的示例_Dart_Dart Polymer - Fatal编程技术网

使用polymer.dart在dart中进行双向数据绑定的示例

使用polymer.dart在dart中进行双向数据绑定的示例,dart,dart-polymer,Dart,Dart Polymer,我看到了使用{my_var}}格式的单向数据绑定的示例,但是,我没有看到将更改从HTML端绑定回dart对象的方法。例如,输入框文本正在更改。上有几个示例 以下是文本输入绑定的具体示例: <polymer-element name="my-example"> <template> <div> Type something: <input type="text" value="{{message}}"> </di

我看到了使用{my_var}}格式的单向数据绑定的示例,但是,我没有看到将更改从HTML端绑定回dart对象的方法。例如,输入框文本正在更改。

上有几个示例

以下是文本输入绑定的具体示例:

<polymer-element name="my-example">
  <template>
    <div>
      Type something: <input type="text" value="{{message}}">
    </div>
    <div>
      You typed {{message}}
    </div>
  </template>
  <script type="application/dart" src="my_example.dart"></script>
</polymer-element>



import 'package:polymer/polymer.dart';

@CustomTag('my-example')
class MyExample extends PolymerElement with ObservableMixin {
  @observable String message;
}

键入以下内容:
您键入了{{message}}
进口“包装:聚合物/聚合物.dart”;
@CustomTag(“我的示例”)
类MyExample使用ObservableMixin扩展了聚合关系{
@可观测字符串消息;
}