polymer

import polymer core-scaffold breaks google maps

两盒软妹~` 提交于 2020-01-15 12:57:25
问题 I have some working dart polymer code that shows a google map with some markers on it. It took me a while to get those to show up, as it seems the initialization routines are a bit wonky and it's as if sometimes there is not enough time to load the map div before it tries to render. Anyway, as I said I got that working. Now I wanted to put a core-scaffold around it, as they do on many demos. The minute I add this line... <link rel="import" href="packages/core_elements/core_scaffold.html"> ..

import polymer core-scaffold breaks google maps

Deadly 提交于 2020-01-15 12:56:49
问题 I have some working dart polymer code that shows a google map with some markers on it. It took me a while to get those to show up, as it seems the initialization routines are a bit wonky and it's as if sometimes there is not enough time to load the map div before it tries to render. Anyway, as I said I got that working. Now I wanted to put a core-scaffold around it, as they do on many demos. The minute I add this line... <link rel="import" href="packages/core_elements/core_scaffold.html"> ..

How can I access DOM elements in Polymer elements from a global namespace?

半城伤御伤魂 提交于 2020-01-15 11:13:28
问题 I want to access a DOM element that's in my-app-as-an-element.html from my app.dart global (because it's a method I want to call from several places, e.g. it changes the page title), but as it's wrapped in shadows and all, I can't seem to get at it. There's a trick to do e.g. HtmlElement el; el = document.querySelector('body /deep/ #page-title'); But /deep/ isn't respected in Safari, so that's off the table. Ideas? 回答1: What you are trying to do goes directly against the philosophy of Polymer

Does core Polymer 2.0 support two-way binding?

不问归期 提交于 2020-01-15 10:14:08
问题 I seem to be having trouble getting two-way binding to work with Polymer 2.0. I'm keeping things minimal, only using Polymer.Element. I define a parent component: <dom-module id="example1a-component"> <template> <xtal-fetch req-url="generated.json" result="{{myFetchResult}}"></xtal-fetch> <div>fetch result: <span>{{myFetchResult}}</span> </div> </template> <script> class Example1a extends Polymer.Element{ static get is(){return 'example1a-component'} static get properties(){ return {

Use of Pseudo-Elements in Polymer.js

巧了我就是萌 提交于 2020-01-15 09:28:50
问题 I'm taking my first steps with Polymer.js, and I'm struggling with creating a pseudo-element. This is what I tried: In my host document: <style type="text/css"> #host::x-a-cool-test { color: green; } </style> <div id="host"> <my-custom-element></my-custom-element> </div> In my custom element: <element name="my-custom-element"> <template> <style> @host { * { display: block; color: blue; } } </style> <div id="group" pseudo="x-a-cool-test"> just some text </div> </template> <script> Polymer

paper-dropdown-menu not working in a lit-element

▼魔方 西西 提交于 2020-01-15 09:13:49
问题 Edit : Turns out, it helps if you import paper-listbox before using it in another element. For some reason I thought it was being imported as a dependency on another element I was importing, but no. As soon as I added the explicit import, it began working correctly. Original question follows. To start, this problem only happens when using paper-dropdown-menu (with paper-listbox inside) in a lit-element . We're using the component in almost the exact same way in multiple PolymerElement (s)

Can't find element inside template with querySelector - Polymer

╄→гoц情女王★ 提交于 2020-01-15 07:33:48
问题 When I try to querySelector an element inside a template tag from external file I get undefined, after a little bit of searching the only solution I found was the 'shadowRoot' but when I tried to use it I got 'shadowRoot is not defined'. 回答1: The following code works fine for me (jsbin): <template is="auto-binding" id="tmpl"> <h1>Hello from {{foo}}</h1> </template> <script> document.addEventListener('polymer-ready', function() { var tmpl = document.querySelector('#tmpl'); tmpl.foo = 'my thing

Setting up Polymer with Jekyll?

梦想与她 提交于 2020-01-14 13:27:28
问题 I'm trying to use Polymer with a Jekyll site, but I can't figure out how to get things set. I downloaded and can run the Polymer Starter Kit. Polymer has the page contents in the app directory, but if I try to set up and run Jekyll from this folder, I get a load of errors because the Polymer index.html can't find the resources (because the root directory is different). What is the correct way to set-up and structure for Jekyll and Polymer to work together? 回答1: Reading polymer started kit

Setting up Polymer with Jekyll?

送分小仙女□ 提交于 2020-01-14 13:27:27
问题 I'm trying to use Polymer with a Jekyll site, but I can't figure out how to get things set. I downloaded and can run the Polymer Starter Kit. Polymer has the page contents in the app directory, but if I try to set up and run Jekyll from this folder, I get a load of errors because the Polymer index.html can't find the resources (because the root directory is different). What is the correct way to set-up and structure for Jekyll and Polymer to work together? 回答1: Reading polymer started kit

Polymer Template: What are valid selects for content insertion points

依然范特西╮ 提交于 2020-01-14 09:13:29
问题 This may be fairly simple question, and though I can find some simple examples, I cannot find documentation on this on the Polymer Project website. In the template for an element, you may use: <content select="value"></content> My question is what are valid values for the select attribute. Is it simply an element? Can it be any simple CSS selector (such as "#id" )? Can it be a bound value ( "{{data}}" )? While, ultimately, I'm just looking for the answer, I would also gladly accept a document