polymer

Polymer: How to loop and render HTML to screen

微笑、不失礼 提交于 2019-12-09 16:29:04
问题 I am working on a widget that pulls third party information from a database using json. Once the information has been collected, I plan to loop through the information and create the required HTML code and insert this into the template via a {{variable}} Now I am getting an unexpected result. When I do this, the html is being displayed as text. Here is some sudo code of the issue: <polymer-element name="loop-element"> <template> {{customerList}} </template> <script> Polymer('loop-element', {

External CSS affecting (“bleeding” into) shadow DOM with Polymer

孤者浪人 提交于 2019-12-09 13:40:08
问题 I must be missing something, but I can't figure it out what. I have simple custom element implemented with polymer: <polymer-element name="test-elem"> <template> <content></content> <div id="container"> <div class="deepinside"> TECK ... CHEST </div> </div> </template> <script> Polymer('test-elem', { applyAuthorStyles: false, }); </script> </polymer-element> I then use it in a simple page: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict

Templating in Polymer: How to load components into a specific layout

 ̄綄美尐妖づ 提交于 2019-12-09 13:37:24
问题 I am coming from a PHP/Laravel direction and there we use the blade templating engine to load components into a specific layout like this: Main Layout called: layout.blade.php <html> <head><title>Whatever</title></head> <body> @yield('content') </body> And then we load our components inside this layout by a file like this, called: content.php @extends(layout) @section('content') <h1>This contents is loaded into the Layout</h1> <p>Yada yada yada</p> @stop In the backend we link the route (lets

Polymer Template Repeat Over Multiple Charts

二次信任 提交于 2019-12-09 13:31:14
问题 I have a polymer highcharts element that works: <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js"></script> <script src="http://code.highcharts.com/highcharts.js"></script> <script src="bower_components/platform/platform.js"></script> <link rel="import" href="bower_components/polymer/polymer.html"> <polymer-element name="bar-chart" attributes="source"> <template> <div id="container" style="max-width: 600px; height: 360px;"></div> </template> <script> Polymer("bar

Chrome Web Components: Polymer needed?

白昼怎懂夜的黑 提交于 2019-12-09 12:29:46
问题 I understand Chrome is becoming complete in terms of Web components requirements. Does that mean Polymer is no longer strictly needed? 回答1: 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

Detect browser support fo Polymer

旧城冷巷雨未停 提交于 2019-12-09 09:48:06
问题 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

How to measure common coverage for Polymer components + .js files?

落花浮王杯 提交于 2019-12-09 06:54:52
问题 How to measure common coverage for Polymer components with all .js files in solution (for non-component tests QUnit is used)? I tried karma-coverage, but it works only for .js files. 回答1: For Polymer, you would normally use web-component-tester (WCT) to test your components, and the web-component-tester-istanbul plugin for code coverage. You'd configure wct.conf.json in the root of your project with something like this: { "suites": [ "test/components/my-view1/my-view1.html" ], "plugins": {

How to test Polymer Dart

浪尽此生 提交于 2019-12-09 01:52:30
问题 I started testing my web components and noticed that Dart has a good library for that and it does work well with Dart. But now I also want to test my Polymer component, but I'm having a hard time doing that. It seems that my Unit Test does not recognize my Element as a Polymer Element. That how my "test" looks like at the moment test.dart import "../../../components/medium/bar-chart.dart"; import "package:unittest/unittest.dart"; import 'package:polymer/polymer.dart'; import 'dart:html'; main

How do I mock polymer core ajax, for unit testing

那年仲夏 提交于 2019-12-08 21:23:16
问题 I am building the scaffolding for my new polymer project, and am considering unit tests. I think I will be using the karma/jasmine combination. There is an interesting post at http://japhr.blogspot.co.uk/2014/03/polymer-page-objects-and-jasmine-20.html which I understand enough to get me started, but the key question I will have to address and haven't found any standard way to do it is how do I mock the ajax calls. When I was using jasmine, standalone, on a JQuery Mobile project, I was able

How to get response from an iron-form Polymer 1 request

血红的双手。 提交于 2019-12-08 19:14:16
问题 i'm trying to get the response from an iron-form in Polymer 1 . Form submit call a php script which return HTML code to insert in a div ( ul and some li ). I use the iron-form event " iron-form-response " but i don't know how to get the response. I can see the response in network tab of browser developer tools, but don't know how to get it in my element. I don't find how to do in the iron-form documentation online. Can someone help me please ? 回答1: What's happening, guys? All these responses