I got problems understanding why data binding with polymer works some times, and some times not.
Given following snippet, why does the first value work and the second not? Where is this behaviour documented? Bug or feature?
<script src="https://elements.polymer-project.org/bower_components/webcomponentsjs/webcomponents-lite.js"></script> <link rel="import" href="https://cdn.rawgit.com/download/polymer-cdn/1.0.1/lib/paper-input/paper-input.html"> <dom-module id="data-binding"> <template> <paper-input label="Input" id="input" value="{{q::input}}" autofocus> </paper-input> <p>Value working: <b>{{q}}</b></p> <p>Value (not working): {{q}}</p> </template> <script> (function () { Polymer({ is: 'data-binding', properties: { }, }); })(); </script> </dom-module> <data-binding></data-binding>
This is documented here .
The binding annotation must currently span the entire content of the tag
String concatenation is not supported inside a tag, and the tag can't contain any whitespace:
Note that it says currently . So this may change in the future.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.