polymer

Polymer input change event

匿名 (未验证) 提交于 2019-12-03 02:49:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: All I want is to be able to get the input from a polymer element <paper-input> and alert it onchange WITHOUT creating a custom polymer element. issues: on-change doesn't do anything I doubt this.value will do anything Pseudocode: <!DOCTYPE html> <html> <head><!--insert proper head elements here--></head> <body> <paper-input floatingLabel label="test" on-change="alert(this.value)"></paper-input> </body> </html> 回答1: I don't know if the OP wanted a change callback while typing...but for Polymer 1.0+ one can listen to the changes while typing

Polymer scrolling issue

匿名 (未验证) 提交于 2019-12-03 02:20:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: Hi I'm just playing around a bit with polymer and got a problem. First here is the Page I'm editing: http://beta.sgbvm.de/app/site/berichte.php The most things works pretty well (e.g. transitions etc) but when i scroll down the list and then click on a card the site stays at the bottom, but i want it to scroll up. By now i searched the for nearly 5 hours but i cant figure out how to scroll back to the top after i click on a card. I read something about accessing the shadowDom but i didnt unterstand what they where talking. <html> <head>

Polymer + Firebase (Polymerfire): &lt;firebase-query&gt; not working inside single page app view (with &lt;firebase-app&gt; located in my-app.html)

匿名 (未验证) 提交于 2019-12-03 02:00:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I'm trying to push data to Firebase using Polymerfire and the Polymer App Toolbox template: my-app.html contains a configured component. my-models.html (which is a page configured in my-app.html routes) contains a component is a form with a , , input, and submit button. I attempt to push data using with the following function in the add-model.html Polymer object: Polymer({ is: 'add-model', properties: { data: { type: Object } }, create: function() { this.$.query.ref.push({ name: this.$.myModelName.value }); } }); Outcome Calling push on the

Custom Polymer element extending AElement in Dart

匿名 (未验证) 提交于 2019-12-03 01:58:03
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I'd like to create custom Polymer element 'ab-btn' which extends 'a' element. It should be used as: Google my html declaration of polymer element looks like (script is listed at the end, because I want to declare more elements in one file): and dart script for the element is like: import 'package:polymer/polymer.dart'; import 'dart:svg'; @CustomTag('ab-btn') class AbBtn extends AElement { AbBtn.created() : super.created(); var inputMethodContext; } When I try to use this element I always get error: #13 _ZoneDelegate.run (dart:async/zone.dart

Importing Polymer web components from remote URLs

匿名 (未验证) 提交于 2019-12-03 01:44:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 由 翻译 强力驱动 问题: I have created a custom Polymer 2.0 based web component which aims to be installed on third-party websites in order to display content managed from my website. The web component in question depends on 3 other custom web components but also on iron-ajax , iron-dropdown , iron-icon , iron-icon-svg , marked-element and paper-icon-button . In order to maximize browsers compatibility, the code is transpiled to ES5 by using polymer-build with the default es5-bundled preset. Once done, the build folder is deployed on Firebase hosting and

Registering a custom element from a chrome extension

匿名 (未验证) 提交于 2019-12-03 01:23:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 由 翻译 强力驱动 问题: I have tried registering custom elements through native javascript and polymer from within a chrome extension with no luck. The issue is documented here . Uncaught NotSupportedError : Failed to execute 'registerElement' on 'Document' : Registration failed for type 'polymer-element' . Elements cannot be registered from extensions . I am looking for suggestions for using web components in an extension - has anyone done so? My instinct is to register these elements using standard html tags (div, etc...) on the shadow DOM for the time

Is there a stamp event for polymer templates?

匿名 (未验证) 提交于 2019-12-03 01:20:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 由 翻译 强力驱动 问题: I am trying to focus an input element inside of a polymer template every time it stamps its contents. The problem is that I cannot select the input element until the template has loaded. Currently, I am just using setTimeout to focus the input 100ms after the template should load, but I want to know if there is a more elegant solution. Also, the autofocus attribute doesn't work, because the template may un-stamp and re-stamp many times. Right now, my code looks something like this (this is inside a polymer element definition):

How to inject HTML into a template with polymer

匿名 (未验证) 提交于 2019-12-03 01:18:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I'm using polymer-jsonp to perform JSONP requests, but the response sometimes contains html. For example, supposing that post.content is " Foo bar" , how can I display {{post.content}} such that "Foo" is in bold? {{post.content}} 回答1: Polymer will not stamp unescaped HTML via data-binding because it becomes a vulnerability for XSS attacks. There are talks ongoing about making it possible to stamp HTML under limited circumstance, or to allow for customized filtering, but this is not implemented yet at the data layer. It is possible to do what

Dartlang with polymer character encoding

匿名 (未验证) 提交于 2019-12-03 01:12:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: Main html: .... Login.html ... ... ({{loginstatus}}) ..and the login.dart snippet: What can I do... 回答1: A while ago I posted the code for a tag at HTML Tags Within Internationalized Strings In Polymer.dart (original form Bind content containing html tags ) Using this polymer element shows proper characters. Your login.html would then look like:

Polymer 3.0 Uncaught DOM Exception When using Paper-Input

匿名 (未验证) 提交于 2019-12-03 01:09:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: 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? 回答1: UPDATE The issue is caused by two different versions of iron-meta in node_modules : an older version in ./node_modules/@polymer