polymer

polyserve cannot serve the app

狂风中的少年 提交于 2019-12-12 20:25:36
问题 Node v8.11 NPM v5.6 Whenever I try to call polymer serve an error occurs telling that server failed to start and no available ports, which is wrong! most of the ports are available. $ polymer serve ERROR: Server failed to start: Error: No available ports. Ports tried: [8081,8000,8001,8003,8031,2000,2001,2020,2109,2222,2310,3000,3001,3030,3210,3333,4000,4001,4040,4321,4502,4503,4567,5000,5001,5050,5432,6000,6001,6060,6666,6543,7000,7070,7774,7777,8765,8777,8888,9000,9001,9080,9090,9876,9877

multiple iron-collapse not working, expands only first

非 Y 不嫁゛ 提交于 2019-12-12 20:09:17
问题 I'm trying to create multiple iron-collapse elements with content inside. I want the iron-collapse to expand when user clicks on a button. The problem is that I can't get each element expanded individually. The script catches only first element and does not affect the others. I've tried many code samples but without success. Can someone help me? My code is below: var expandContent = document.getElementById('mybutton'); expandContent.onclick = function(event) { var moreInfo = document

Polymer: Delay value changed execution

删除回忆录丶 提交于 2019-12-12 18:41:09
问题 Got a simple Polymer template containing: <paper-input floatingLabel label="Suche" value="{{search}}" error-message="Invalid input!"></paper-input> and JS: properties : { search : { type : String, notify : true, observer : 'searchChanged' } }, searchChanged : function() { this.$.searchAjax.url = /search/" + this.search; this.$.searchAjax.generateRequest(); } So everytime the value changes the server is queried with a new URL. This works good but I want to delay the request to the server for

InvalidCharacterError: “fred”

流过昼夜 提交于 2019-12-12 17:41:22
问题 I am sure his must be a newbie question. In simple terms I wanted to define my first Polymer-dart component. Only I keep kicking my toe on the same speed-hump. To keep things very simple, I've stripped it back to a very simple example. I did a simple rename of the example: ' stopwatch 'component from the Dart component Polymer-dart tutorial: Define a Custom Element I had errors similar to the one in the question title, so the renamed component is: ' fred ' ... from: ' tute-stopwatch ' When

Polymer: Detect click outside of custom element

半腔热情 提交于 2019-12-12 17:16:49
问题 I have a custom element and would like to detect clicks outside of it. For example <dom-module id="simple-element"> <style> </style> <template> <content></content> </template> </dom-module> <script> (function() { Polymer({ is: 'simple-element', listeners: { 'tap': 'regularTap' }, regularTap: function() { console.log("i was tapped"); } }); })(); </script> Is there an event where I can listen to which will tell me when user has clicked outside of the element? Thanks. 回答1: Something along these

Polymer 1.0: Sorting iron-list

泪湿孤枕 提交于 2019-12-12 17:08:42
问题 Google's Polymer creators claim we can manually sort <iron-list> (resolving this issue, perhaps?). Also see this issue. Per @emmanuel on the Polymer Slack Site: You can set list.items = newItems and that will refresh the list. Here is my code. But it's not working. Please help. This section of code seems to be the problem. //this.$.list.items = this.items.sort(this._computeSort(val, ord)); //this.items = this.items.sort(this._computeSort(val, ord)); //this.items.sort(this._computeSort(val,

Polymer iron-ajax and asynchronous requests (etag sync and response handling)

你离开我真会死。 提交于 2019-12-12 17:03:55
问题 I'm looking for a tried and true way of handling asynchronous calls to API endpoints returning JSON (using polymer's latest rendition of the iron-ajax element). These API calls rely on etag matching, so it is important that the etag sent matches the one on the server. I have that part working, except in certain circumstances, where quick succession API calls may cause an out-of-sequence response (and therefore can get the etag out of sync). There are also multiple API endpoints (i.e.

How do I build a Polymer 2.x project with Polymer CLI?

风格不统一 提交于 2019-12-12 15:28:31
问题 Can anyone point me to a tutorial that uses Polymer 2 and polymer-build from Polymer CLI? When I use any example in the polymer-starter-kit and use polymer serve , it works fine; but when I use polymer build and serve the bundled or unbundled directory, I get 404 errors. I have even updated to the newest alpha version of polymer-cli . Also, using https://github.com/tony19/generator-polymer-init-2-x-app generators have the same problem. 回答1: I also spent quit a bit of time to figure this one

Add or Append HTML inside of a Polymer Element's template from Javascript

泪湿孤枕 提交于 2019-12-12 15:20:13
问题 In an attempt to get carousel functionality working inside of a Polymer element, I am programmatically creating the markup needed for the Slick carousel inside of my element's script. Assume in this code snippet that this.videos has already been loaded as an array of objects that contain youtube video information, specifically an id and name property: // Create Carousel Container var carousel = $('<div id="carousel"></div>'); // Add Slides this.videos.forEach(function(element, index, array){

KnockoutJS + Polymer: bindings break (Outside of Chrome)

此生再无相见时 提交于 2019-12-12 14:40:49
问题 EDIT: This only appears outside of Chrome I'm using KO to fill in elements using foreach bindings. On the other side of the coin, I've got Polymer loaded up to make use of Google's Material Design styling. The issue is that there seems to be an assertion in the platform.js file (Polymer) that is trying to take over the data-bind even though Polymer doesn't use the data-bind attribute. Wondering if anybody has had any experience using both of these, or any suggestions? Error is below: Error: