polymer

Is there the a way to prevent HTML escaping inside a Polymer expression? [duplicate]

孤人 提交于 2019-12-22 08:55:35
问题 This question already has an answer here : How can I bind a text which contains url as html (1 answer) Closed 5 years ago . My colleague Patrick & I currently converting an autocomplete component from Web UI to Polymer.dart.In Web UI we provided a HTML rendered list to the autocomplete in order to give a programmer the opportunity to style the results. Based on the input's value we filtered the list and displayed the matching results. What would you recommend to achieve the same behaviour in

Polymer dom-repeat how to notify array updated

主宰稳场 提交于 2019-12-22 08:20:32
问题 So I have this Polymer element with dom-repeat. It binds correctly. However, when the array is modified, it doesn't reflect back to DOM. Nothing changed when I click on the button. <dom-module id="my-element"> <template> <template is="dom-repeat" id="allRules" items="{{allRules}}"> <span class="tag" rule-enabled$={{item.enabled}}>{{item.name}}</span> </template> <button on-click="click">Click me</button> </template> </dom-module> <script> Polymer({ is: "my-element", properties: { allRules: {

JavaScript Encapsulation with WebComponents/ShadowDOM

亡梦爱人 提交于 2019-12-22 08:16:53
问题 Probably simple question, that I haven't really found an answer for: Does ShadowDOM or WebComponents (as the bigger Standard) actually encapsulate JavaScript aswell? Like having seperate namespaces for each component? From what I encountered with Polymer that wasn't the case yet, which is obvious, given that polymer is doing it's polyfilling through JS. Thanks! 回答1: The Shadow DOM and Custom Element specs say nothing about script encapsulation. The only thing that SD gives you is <style>

How to broadcast an event down to an element from rootScope in Polymer?

主宰稳场 提交于 2019-12-22 08:14:28
问题 For example, we have root scope <template is="dom-bind" id="app"> <div id="element-on-branch"></div> <my-element></my-element> </template> Then fires an event this.fire('custom') It goes to root and then I need to route this event to . How can I broadcast an event or notify branched elements? Thank you! 回答1: You can use iron-signals. Fire an iron signal event inside your element: this.fire('iron-signal', {name: 'mysignal', data: "data"}); Then listen to that signal from anywhere in your

Require.js to load all resources for an app, including Polymer

南笙酒味 提交于 2019-12-22 06:15:46
问题 I am building an app framework for a large, multi developer project. I am sold on the idea of using Require.js and Angular together to manage dependency and class loading. But now I want to use Polymer as well, because it's insanely cool. How could I use require.js to load polymer elements libraries just the same as my js ones? I like the idea of hanging on to require as THE one true way to load all my apps resources. I see how nice it is to be able to bundle template,script and style into

How to get query string in Polymer

流过昼夜 提交于 2019-12-22 05:55:01
问题 Is there anyway how can I get query string in Polymer? http://localhost:8080/search?param=ppshein I want to get search?param=ppshein or param=ppshein in Polymer. I've tried to get query string in app-route but it display nothing. <app-route route="[[route]]" pattern="/:id" data="{{routeData}}"></app-route> [[routeData.id]] ** 回答1: You could use <app-location>.queryParams: <app-location route="{{route}}" query-params="{{queryParams}}"></app-location> queryParams is an object containing key

In Polymer 1.0 how can I databind to a boolean property of an element?

江枫思渺然 提交于 2019-12-22 05:53:56
问题 How can I bind to a boolean property of an element. It seems this <my-element a-property-of-type-boolean='{{someBoolean}}'></my-element> does not Work, but I also cant find out how to bind to it when it is exposed like this: <my-element a-property-of-type-boolean></my-element> It seems an option is to set the type to Object instead of Boolean, but I am not sure how valid this approach is Thanks :-) 回答1: If you put an attribute on your element, the related property it will always be true. For

Polymer - How do I attach an observer to an array?

Deadly 提交于 2019-12-22 05:15:22
问题 How do I attach an observer to a polymer attribute that is an array? To be clear, I want callbacks when items in the array change. For simplicity, let's say my array is: [ { text: 'foo' }, { text: 'bar' } ] I want something like: observe : { 'items.text' : 'itemsChanged' } The following works, but is obviously un-sustainable: observe : { 'items[0].text' : 'itemsChanged', 'items[1].text' : 'itemsChanged' } Note that in my case, the changes are coming from another polymer element that I have

How to register Custom HTML Element as widget in GWT

那年仲夏 提交于 2019-12-22 05:05:04
问题 Hi folks Did someone have any idea how to register custom html element as GWT widget uiBinder and use them directly in place of using in HTMLPanel. For e.g. if I'm using Google Polymer in my mgwt project I'm using custom html element as <g:HTMLPanel > <paper-shadow class="{style.card}"> <mgwt:touch.TouchPanel ui:field="touchPanel"> <mgwt:panel.flex.FlexPanel orientation="VERTICAL" alignment="CENTER"> <g:Image url="{global.getDirection.getSafeUri.asString}" /> <g:HTMLPanel>Take me to Deal</g

Access shadow DOM properties (polymer) with javascript/jquery?

允我心安 提交于 2019-12-22 04:35:12
问题 I'm currently using polymer's core-scaffold & co. to create an header/sidebar with a content area. I'm currently having the problem that I cannot access certain properties of the content element, such as scrollTop. (since the actual scrollTop property that I need to access is defined in the shadow DOM.) This conflicts with a lazyload jquery plugin I'm using. The plugin is checking the window.scrollTop but changing the plugin to check the scrollTop of my content (that scrolls instead of the