polymer

Angular2 Template parse errors: Property binding ngFor not used by any directive on an embedded template

怎甘沉沦 提交于 2019-12-10 15:33:38
问题 This is the Angular2 template: <paper-dropdown-menu label="Country"> <paper-listbox class="dropdown-content" [(ngModel)]="selectedCountry" (ngModelChange)="GetAdmin1s($event)"> <paper-item *ngFor="let country of countries" value="{{country.Id}}">{{country.Name}}</paper-item> </paper-listbox> </paper-dropdown-menu> I am getting this error: "Template parse errors: Property binding ngFor not used by any directive on an embedded template (""dropdown-content" [(ngModel)]="selectedCountry"

Installing Polymer through bower freezes

别说谁变了你拦得住时间么 提交于 2019-12-10 15:07:50
问题 I follow the instructions of the official page to install bower, but when I reach to the command line: bower install --save Polymer/core-elements bower get stuck and outputs nothing for a long while, in the end I get a "out of memory" error. What is wrong? I am using Ubuntu 14.04 回答1: There's a cyclical issue with Bower that's been fixed on master but hasn't made it to a release yet. https://github.com/bower/bower/issues/1169 回答2: according to http://github.com/bower/bower/issues/1324 there

Manually recalculate 'computed properties'

前提是你 提交于 2019-12-10 14:55:40
问题 If I have a custom element Polymer({ name: 'dane', computed: { message: 'greet(name)' }, greet: function(name) { return 'hello ' + name + Date.now(); } }) When I change name polymer will automatically recompute message , but is there a way to recompute message without changing name ? 回答1: You could add another input value to the compute expression, i.e.: message: 'greet(name,x)' and then force a re-compute by updating x. Keep in mind computed properties are read-only so you can't directly

How can I use the :first-child selector w/ shadow DOM's <content> element?

放肆的年华 提交于 2019-12-10 14:53:00
问题 I'd like to extract the first paragraph from a custom element's content (as a summary). I would expect the following to work: <polymer-element name="x-thing" noscript> <template> <segment class="summary"> <content select="p:first-child"></content> </segment> <segment> <content></content> </segment> </template> </polymer-element> Unfortunately, the <content select="p:first-child"> doesn't appear to match anything :( Here's a corresponding codepen. 回答1: Only :not() is supported in the Shadow

dart-polymer: cannot set an attribute from an event handler

若如初见. 提交于 2019-12-10 14:49:52
问题 The following code doesn't work. Maybe I do something wrong.. Please correct my code: index.html: <html> <head> <title>Page</title> <link rel="import" href="msg_box.html"> </head> <body> <msg-box id="msg" caption="Caption 1"></msg-box> <button id="btn">click me</button> <script type="application/dart" src="index.dart"></script> <script src="packages/browser/dart.js"></script> </body> </html> import 'dart:html'; import 'package:polymer/polymer.dart'; import 'msg_box.dart'; void main() {

paper-menu-button's dropdown (paper-menu) not overlaying other iron-list items

落花浮王杯 提交于 2019-12-10 14:48:12
问题 I'm running into an issue using polymer 1.0's paper-menu-button . It's dropdown menu isn't overlaying neighbouring iron-list elements. I am building an element that displays items using iron-list , and each item has a dropdown menu of options that can be performed on that particular iron-list item. However, the paper-menu-button 's paper-menu dropdown is not appearing on top of neighbouring iron-list items, only on top of it's own list item. I've tried inspecting items in Chrome, and playing

Polymer Paper-Radio-Group - how to have multiple radio buttons with the same name

不想你离开。 提交于 2019-12-10 14:36:52
问题 I'm using Paper Elements from the Polymer Project to build a form, and have run into a problem using the paper-radio-group tag and its children, paper-radio-button . With a normal radio button list, I would do the following: <input type="radio" name="myFieldName" value="MyFirstOption" /> <input type="radio" name="myFieldName" value="MySecondOption" /> <input type="radio" name="myFieldName" value="MyThirdOption" /> Note that the name attributes are the same, grouping the radio buttons and

How to change Polymer(1.0) paper-toolbar background colour?

不问归期 提交于 2019-12-10 13:08:36
问题 Yesterday I decided to try Polymer 1.0 and I'm already facing difficulties when trying to styling the paper-toolbar. The documentation says that the background colour can be changed by using: --paper-toolbar-background But how can I use it on CSS? I tried the following: paper-toolbar { --paper-toolbar-background: #e5e5e5; } Also this: paper-toolbar { --paper-toolbar { background: #e5e5e5; } } But neither worked. What is the correct way to do it? Thanks. 回答1: If you are styling it on your main

Conditionally add css class in polymer

笑着哭i 提交于 2019-12-10 12:42:21
问题 I have an element inside a polymer component and want to add a css class conditionally. <div class="bottom {{completed: item.completed}}"> if item.isCompleted is true, then add the .completed class. However, I've got the following error: Invalid expression syntax: completed?: item.completed I don't want to put the hole subtree inside a template conditional. Is it possible to do using an expression inside an html tag? I'm using the last polymer release, is this funtionallity migrated or

Use Firebase-query to get data from an array of ID's

[亡魂溺海] 提交于 2019-12-10 12:18:36
问题 I'm trying to use Polymerfire's firebase-query to retrieve a list of children for each ID in an array. I have and array with three ID's and a firebase-query that looks like: <firebase-query id="teamContacts" path= "{{teamConPath}}" data="{{teamConData}}"></firebase-query> and a couple observers that look like: teamConData: { observer: '_teamConDataChanged' }, teamConPath: { value: '', observer: '_teamConPathChanged' }, _teamConPathChanged: function(newValue, oldValue) { var self = this; if (