Polymer 1.0 binding properties to inline styles in template -
i in polymer...
<dom-module id="logo-standard"> <style> :host { display: block; } </style> <template> <div class="logo-wrap"> <div style="width: {{logowidth}}px;"> awesome logo </div> </template> <script> (function() { polymer({ is: 'logo-standard', properties: { logowidth: { type: string, value: '400' } } }); })(); </script> </dom-module>
i.e. dynamically style element using property.
is possible? if so... how?
this question has been answered me here
as of polymer 1.2.0, can use compound bindings to
combine string literals , bindings in single property binding or text content binding
like so:
<img src$="https://www.example.com/profiles/{{userid}}.jpg"> <span>name: {{lastname}}, {{firstname}}</span>
and example
<div style$="width: {{logowidth}}px;">
so no longer issue.
Comments
Post a Comment