polymer

Finding the element associated with a particular instance of dom-repeat

被刻印的时光 ゝ 提交于 2019-12-11 05:01:56
问题 I have a custom element that generates a large monthly calendar on the page. This is created with a pair of nested dom-repeats the outer one providing each week of the month and the inner one providing the days within the week. Initially this starts out quite empty, but then a ajax request returns with data which fills in the model, providing considerably more data for each day. When a user clicks on one of the days I will (just started to implement it) open a dialog box with much more

How to Run Function Once On Load (then by Observer) in Polymer

混江龙づ霸主 提交于 2019-12-11 04:57:41
问题 I am trying to run getResponse once when this web component loads, and then each time the procedure property changes. However, when trying to run this debounce function, it is invoked 4 times and getResponse runs after a delay, but 4 times instead of 1. static get properties() { return { procedure: { type: String, observer: 'getResponse' }, timeout: { type: Number, value: null } } } ready() { super.ready(); this.debounce(); } debounce() { console.log('debounce'); this.procedure =

Updating children of polymer elements using Angular doesnt cause parents to reload and rebind

人盡茶涼 提交于 2019-12-11 04:48:58
问题 tldr: When children of paper-dropdown-menu are updated by Angular, the parent does not reload or react to the change. The "selected" option does not bind to the new items, for example, unless we it update as well. The example code is available here: https://github.com/dirtysanchez69/issue-angular2-polymer Say I have a paper-dropdown-menu, as such (this works fine): //hardcoded options and selection <paper-dropdown-menu label="hardcoded options and selection"> <paper-listbox [selected]="1"

What is the best way to dynamically change the style of an application built with Polymer?

感情迁移 提交于 2019-12-11 04:47:17
问题 My idea is to have different files (either .css or .html) containing all the rules for a specific theme and load theme dynamically changing the look&feel of the Polymer application at runtime. I have found pretty useful this method described here by Polymer itself with using custom style at document level (using .html files) Frequently you want to define custom property values at the document level, to set a theme for an entire application, for example. Because custom properties aren't built

iron-scroll-threshold is never executed after first list scolling is end in polymer

夙愿已清 提交于 2019-12-11 04:42:44
问题 I've done as follow by using iron-list and iron-scroll-threshold in order to implement infinite-scrolling in polymer. But problem is loadMoreData for iron-scroll-threshold is never executed after first list scrolling is end in polymer. Please help me which one is missing or wrong in my code. Thanks. <template> <iron-ajax id="ajax" url="https://randomuser.me/api/" handle-as="json" params='{"results": 20}' loading="{{loadingPeople}}" on-response="categoriesLoaded"> </iron-ajax> <app-toolbar>

how to import a css file from an npm module - webcomponent

*爱你&永不变心* 提交于 2019-12-11 04:41:32
问题 I'm trying to use MDC Components for material design components on my application. I have a custom element in Polymer (LitElement): _render(props) { return html` ${SharedStyles} <style> .js-panel { display: none; } .js-panel.is-active { display: block; } </style> <div class="mdc-toolbar"> <div class="mdc-toolbar__row"> <div class="mdc-toolbar__section mdc-toolbar__section--align-start"> <nav id="tab1" class="mdc-tab-bar mdc-tab-bar--indicator-accent js-tabs" role="tablist"> <a role="tab" aria

Polymer serve changes the served javascript files for Internet Explorer 11. How to make it work on another web server?

て烟熏妆下的殇ゞ 提交于 2019-12-11 04:34:20
问题 When testing our polymer 2.01 / webcomponents 1.01 Application on Internet Explorer 11 we found out that it works fine using poyfills when serving the Application with polymer serve. It doesn't work when we are serving our application with a naked tomcat 8.x. We get Script Errors like "SCRIPT1003: Expected" with Internet Explorer. The reason for this seems to that polymer serve changes the javascript files when the Client Browser is Internet Explorer 11. For example in webcomponents-lite.js

How to get Polymer domHost property?

自作多情 提交于 2019-12-11 04:11:26
问题 I have a basic Polymer template with a very simple structure, described here: Polymer: can't get this.__data__ passing in from host (codebase is here: https://srgg6701.github.io/Polymer_template) I need to use data passed from parent to children. I can pass them and see it within this.domHost : However, if I try to get this.domHost.properties , it says undefined (!). So, two questions: Why it is undefined here? Is it possible to make this data accessible? 回答1: For Question#1: It's most likely

using HTMLImports.whenReady not working in chrome

我们两清 提交于 2019-12-11 03:56:57
问题 I have a web component using HTMLImports.whenReady to make sure that certain things get fired in the correct timing, and the problem is this fixed the bugs I was having in IE and Firefox, but now it is not working in chrome. so on the page of the site i have this: <link rel="import" href="/static/template/components/result-map.html"> <link rel="import" href="/static/template/components/result-options.html"> <link rel="import" href="/static/template/components/advanced-modal.html"> <link rel=

Cannot select elements inside “auto-binding” template

為{幸葍}努か 提交于 2019-12-11 03:44:47
问题 I have created some custom elements, now I'm writing tests for them. I wanted to use "auto-binding" because I have plenty of attributes that needs to be bound among my elements. Unfortunately I cannot query any element inside the template. Here is some code. <template id="root" is="auto-binding"> <dalilak-data-service id="dds" regions="{{regions}}"></dalilak-data-service> <dalilak-regions-handler id="drh" regions="{{regions}}" flattendedRegions="{{flattendRegions}}" descendantsRegionNames="{