polymer

How to get query string in Polymer

本秂侑毒 提交于 2019-12-05 10:19:10
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]] ** You could use <app-location>.queryParams : <app-location route="{{route}}" query-params="{{queryParams}}"></app-location> queryParams is an object containing key/value pairs of the parsed query parameters. Given http://localhost:8080/search?param=ppshein , queryParams

How do you nest two of Polymer's firebase-collection elements inside dom-repeat?

心已入冬 提交于 2019-12-05 10:08:05
I have a problem of looping two of Polymers firebase-collection elements. With my database structure i first have to check which events the user has access to, then get the information on that event from events. The problem with this code is that when i loop the second firebase-collection the data-binding on "events" will be the same on all that repeats and therefore it will be the same name on every h4. So is there a way of having a unique variable in data="{{ }}". or is there a better way of writing out the data? <firebase-collection data="{{userData}}" location="{{_getCorrectUrl()}}"><

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

旧时模样 提交于 2019-12-05 09:14: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 one logical .html file which represents a component, and I know that we can break those parts out into

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

假如想象 提交于 2019-12-05 08:30:23
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 control over. So if I could somehow trigger a change from the element that has control over { text: 'foo'

app-localize-behavior and shared localization cache

混江龙づ霸主 提交于 2019-12-05 07:19:00
According to the polymer documentation for app-localize-behavior Each element that displays content to be localized should add Polymer.AppLocalizeBehavior. All of these elements share a common localization cache, so you only need to load translations once . In the following snippet (adapted from this answer ) does not find the shared resources in the tag Maybe I missed something ? <!DOCTYPE html> <html> <head> <base href="https://polygit.org/polymer+:master/components/"> <script src="webcomponentsjs/webcomponents-lite.min.js"></script> <script src="https://rawgit.com/yahoo/intl-messageformat

Iron Ajax - How to access Response from on-response function?

走远了吗. 提交于 2019-12-05 07:10:19
I have this element: <template> ... <iron-ajax id="ajax" url="..." handle-as="json" verbose=true last-response={{ajaxResponse}} loading="{{cargando}}" on-response="_handleResponse"> </iron-ajax> <div id="resultado"></div> </template> <script> Polymer({ ... _handleResponse: function(event){ console.log("_handleResponse... "); // this.$.resultado.innerHTML = event.detail.innerHTML; } }); </script> The response I see in Firebug is: <p>Hello word</p> I want to access the response in _handleResponse function in order to set it as innerHTML of the resultado div, but nothing works. I have tried:

Polymer 1.0 - paper-ripple goes all over the screen instead fit in the element

一曲冷凌霜 提交于 2019-12-05 06:37:55
I'm trying to use the ripple effect on a clickable list of items but I'm facing the issue that the ripple effect goes all over the screen when I encapsulate that list into a custom element. It works great if I place it in my index.html but fails when I create a custom element that is included there. See an image of the issue: I've been reading similar questions where the answer is to make the container relative, which should be already done. So I'm wondering if it is required to set any special attribute in the host when using the ripple effect from a custom element. My example code is as

Polymer 3.0 Uncaught DOM Exception When using Paper-Input

孤街醉人 提交于 2019-12-05 06:07:16
When Using paper-input , the import throws the following exception Uncaught DOMException: Failed to execute 'define' on 'CustomElementRegistry': this name has already been used with this registry. I haven't done anything besides creating the template for 3.0 and adding the import. There seems to be an issue with the Migration Tool , Google used to update their old components. Has anybody sorted this already? UPDATE The issue is caused by two different versions of iron-meta in node_modules : an older version in ./node_modules/@polymer/iron-meta at 3.0.0-pre.18 (which is already installed with

polymer iron-ajax : How to Bind data from input element to iron-ajax's body attribute

拟墨画扇 提交于 2019-12-05 05:32:45
I recently have problems binding data from input element to iron-ajax's "body" attribute. When I used core-ajax on polymer 0.5, I can easily bind values like this: <core-ajax id="ajax" method="POST" contentType="application/json" url="{{url}}" body='{"username":"{{username}}", "password":"{{password}}"}' handleAs="json" on-core-response="{{responseHandler}}"> </core-ajax> Now I tried the same thing with iron-ajax. But it sends literally "{{username}}" and "{{password}}" instead of their values. Here is the code: <iron-ajax id="ajax" method="POST" contentType="application/json" url="{{url}}"

Polymer 1.0: User authentication UX (recommendations, tutorials and examples)?

北城以北 提交于 2019-12-05 05:30:38
问题 Is there a recommended "Polymer way" to do user authentication? This question includes both the technical pieces AND the UX. A soup-to-nuts example (and/or tutorial) of a UX for doing user auth would be fantastic. Note: The Polymer Starter Kit does not contain any authentication UX examples. In this question... "UX" means: The COMPLETE "user-experience" involved in signing up for a new account, logging in and handling forgotten user id or password. For example, a typical landing page for a