polymer

How to distribute (insert) content nodes programmatically

99封情书 提交于 2019-12-03 15:19:51
问题 Is there a way to programmatically distribute (insert) content from lightDOM to ShadowDOM? I would like to wrap every single child node into an element. For example : <my-list> <span>first element</span> <div>second element</div> <a>third element</a> </my-link> to be distributed as <my-list> <ul> <li> <span>first element</span> </li> <li> <div>second element</div> </li> <li> <a>third element</a> </li> </ul> </my-link> I need it not only to render that way, but also delegate entire HTML

Polymer HTML Imports Deprecated

依然范特西╮ 提交于 2019-12-03 14:36:20
So I've just got started with polymer and got this message: [Deprecation] Styling master document from stylesheets defined in HTML Imports is deprecated, and is planned to be removed in M65, around March 2018. Please refer to ....... for possible migration paths. After doing some reading it seems to be that <link rel="import" href="/SOR/bower_components/paper-input/paper-input.html"> Was causing the issue and rel=import for html was being deprecated. Is this right? If so what is the fix, how should I be doing this? Cheers The issue has actually been solved by the polymer team, as described on

How to filter an iron-list in polymer 1.0?

北城以北 提交于 2019-12-03 13:33:28
The dom-repeat element offers a filter attribute. Is there a similar way to filter with iron-list ? For example: Given a list of people, I want to filter the ones born in a specific city. daluege As iron-list unfortunately doesn't offer a filter attribute, there is no declarative pattern making this possible. You can either implement your own simple list element making use of dom-repeat 's filter property. (With element inheritance coming back in future releases, you might extend iron-list ). However, the best practice I currently see is the use of a computed property: <template> <iron-list

Chrome Web Components: Polymer needed?

泪湿孤枕 提交于 2019-12-03 13:25:51
I understand Chrome is becoming complete in terms of Web components requirements. Does that mean Polymer is no longer strictly needed? ebidel To be clear, the platform.js layer (the polyfills) go away as native support becomes available in browsers, but polymer.js (sugaring layer on top of web components) and the elements will not. The sugaring is Polymer's opinion on how to use the web components++ tech together, and the elements are generally useful/reusable components. This post describes the pieces of Polymer: What is the difference between Polymer elements and AngularJS directives? Today,

Detect browser support fo Polymer

流过昼夜 提交于 2019-12-03 13:12:50
I'm using Polymer (version 0.5, might upgrade to 1.0 at some point) on a site. Obviously many older browsers don't work well with the Polyfills. Is there a way to test if the polyfills were successful in a specific browser? So, after the polyfill was done, is there some function, object, variable or anything that I can check to see if the polyfills worked? I want to be able to detect failure, and then redirect to a page with a, "please upgrade" message. The only alternative for me is to implement some kind of browser detection middleware in my backend, which I'd prefer to avoid at this point

Is it possible to share mixins across web components (and imports) in Polymer?

我们两清 提交于 2019-12-03 12:40:28
问题 As a follow up to How to extend multiple elements with Polymer and Polymer multiple inheritence/composition, based on their answers, I wonder if it's possible to share mixins across multiple web components (and multiple imports) to reuse functionality. Mixins seem to be the only way to share functionality across multiple custom elements. However, it seems like you can only use a mixin within one import. Which means, if you have a mixin, that gives a web component a specific functionality (let

Polymer Iron Ajax - How to access Response from Request after Error Event?

為{幸葍}努か 提交于 2019-12-03 12:12:42
I use iron-ajax: <iron-ajax id="postLoginForm" method="POST" verbose url="../../login" content-type="application/json" handle-as="json" on-response="_handleLoginResponse" on-error="_handleErrorResponse"></iron-ajax> The server always responds with an error if the request body is empty: Error: The request failed with status code: 422 This triggers my _handleErrorResponse method in which I would like to access the actual response, which looks like this: {"email":["The email field is required."],"password":["The password field is required."]} Here is what my _handleErrorResponse looks like:

How to make a polymer element draggable

↘锁芯ラ 提交于 2019-12-03 12:09:47
I'm trying to enable HTML5 drag and drop on a custom polymer element but it doesn't work. Without polymer it's possible to just add the draggable attribute. Here is my code in Dart: my_component.html <polymer-element name="my-component"> <template> <style> @host { :scope { display: block; } } div { background-color: red; width: 200px; height: 200px; } </style> <div> Drag me </div> </template> <script type="application/dart" src="my_component.dart"></script> </polymer-element> my_component.dart import 'package:polymer/polymer.dart'; @CustomTag('my-component') class MyComponent extends

Google Polymer with rails 4

拈花ヽ惹草 提交于 2019-12-03 10:12:40
问题 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 ? 回答1: 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

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

≡放荡痞女 提交于 2019-12-03 09:27:27
问题 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>