polymer

Migrating Polymer project .5 to 1.0 error

匿名 (未验证) 提交于 2019-12-03 01:07:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I am trying to migrate my project from polymer .5 to polymer 1.0. I have installed new version of polymer library, iron element & paper element. But I am getting following error: polymer-micro.html:63 Uncaught TypeError: prototype.registerCallback is not a function This page does not have any code like: Polymer('shape-menu',... Also, I have noticed that directory structure remains same for core elements. It did not changed to iron/ neon elements. So my code uses the same line to import htmls. Eg: <link rel="import" href="~/Scripts/Polymer

Best way to communicate between instances of the same web component with Polymer?

爷,独闯天下 提交于 2019-12-03 00:58:34
I'm trying to sync some of my web component properties between instances of the same element so if one of this properties changes then the same property gets updated in all the instances with the corresponding binding and events. Note: I want to use the Polymer Data System Concepts for the communications between instances. Example my-element.html <dom-module id="my-element"> <script> Polymer({ is: 'my-element', properties: { myProp: { type: String, notify: true } }); </script> </dom-module> my-other-element.html <dom-module id="my-other-element"> <template> <my-element my-prop="{{otherProp}}">

Polymer paper-dropdown-menu not rendered correctly in browser

匿名 (未验证) 提交于 2019-12-03 00:58:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 由 翻译 强力驱动 问题: I am having an issue with the rendered html for a simple paper-dropdown-menu. The list items do not appear as a styled "menu", but rather just a list of items appearing on the page. Clicking the rendered paper-input component (part of the rendered dropdown) does animate the ripple, but does not animate the show/hide of the menu and menu items. Clicking an item in the list causes the list to disappear, but clicking the dropdown again does not make the list re-appear. After examining the rendered html and comparing it with the same

Google Polymer with rails 4

情到浓时终转凉″ 提交于 2019-12-03 00:38:04
I have build a Ruby on rails app.I want to use polymer with my ruby on rails app. Cam anybody suggest some good resources to learn polymer with rails ? Is it efficient to use polymer with ruby on rails ? Please also suggest other better options than polymer, if any ? adesakin I am using bower, so I expect you already have bower setup on your system. (brew install node && npm install bower) Set up you gems gem 'bower-rails' gem 'emcee' bundle install rails g bower_rails:initialize rails g emcee:install Setup your bower file. Below is what mine looks like: asset 'angular' asset 'angular-route'

How to enforce required paper-radio-group in Polymer?

心已入冬 提交于 2019-12-02 22:49:55
问题 What's the best way to enforce require check on paper-radio-group ? I saw another question and answer that uses fallback-selection , here, but I want to force the user to choose "yes" or "no". <paper-radio-group selected="" attr-for-selected="value" data-required="{{question.required}}"> <paper-radio-button name="{{question.id}}" value="yes">Yes</paper-radio-button> <paper-radio-button name="{{question.id}}" value="no">No</paper-radio-button> </paper-radio-group> The only way I can think of,

Understanding Polymer data-binding and HTML tags

好久不见. 提交于 2019-12-02 19:08:40
问题 I'm new to Polymer and while testing data-binding, I discover that I have to encapsulate double-mustache expressions within HTML tags (for example <span>{{var}}</span> ). If not, variable is simply not expanded and printed as is. An exemple (from Polymer Quick Tour), with a line more to show this behaviour. You can also find it on Plunker. <dom-module id="name-tag"> <template> <!-- Will print : This is {{owner}}'s name-tag element. --> This is {{owner}}'s name-tag element.<br /> <!-- Will

Can I use polymer/web components in a native android app w/o Cordova?

99封情书 提交于 2019-12-02 16:25:39
If I'm not mistaken, you need a web server to use/test Polymer's web components (such as the paper elements) on your computer due to browser permissions issues stemming from loading local file:// s. (A simple solution is to navigate to the directory where the polymer files are you want to try and type python -m SimpleHTTPServer then load http://localhost:8000 and all is good.) But how about if I want to employ web components/Polymer elements in a native java android app inside a simple WebView w/o dealing with Cordova or setting up a web server somehow inside my app. Will I be able to do it

Polymerfire <firebase-app> element crashes app

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-02 16:24:32
问题 I just added the new Polymerfire <firebase-app> element to my (Polymer 1.x + Firebase 3.x) project and it crashed the project. I expected to see the home screen load on localhost but, instead, I just get a blank screen and console error. my-element.html <firebase-app auth-domain="my-app-id.firebaseapp.com" database-url="https://my-app-id.firebaseio.com/" api-key="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"> </firebase-app> The console log reports the following error: Console.log firebase-app

How to display html inside template?

二次信任 提交于 2019-12-02 14:27:52
问题 I have polymer-element: example By default templates is not allowed to insert html. This sample is not working, because it's not allowed to insert html. Maybe exists the way to do that. 回答1: One way to do this is through a *Changed watcher and setting the .innerHTML the node: <div id="div"></div> labelChanged: function() { this.$.div.innerHTML = this.label; } Then, for the <template repeat> case, wrap things up in a custom element that follows the similar pattern: https://stackoverflow.com/a

Polymer 2.0 access a parent component from child component

主宰稳场 提交于 2019-12-02 13:25:27
I have a nested component, what is the Polymer way to travel up the DOM or component tree in this case. <parent-component> <some-component> <component-i-am-starting-from></<component-i-am-starting-from> </some-component> <some-other-component> </some-other-component> </parent-component> I'd like to be at a deep nested component and reference any of the parent components and their models or trigger an event inside one of them. Bonus if I can access sibling components, etc. Traveling down was easy enough with this.$.idOfChildComponent.event() I have tried dispatchEvent, domHost, shadowRoot, can