polymer-1.0

How to view the Polymerfire demo using Polymer’s `polymer serve` polyserve server?

寵の児 提交于 2020-01-03 16:25:11
问题 I want to view this demo of Polymerfire in my browser. I expect to see the demo run in my browser. Instead, I see a blank page and the following console error. console.log.error.message GET http://localhost:8080/ 404 (Not Found) Navigated to http://localhost:8080/ I used the following procedure: I installed the Polymer-CLI multi-tool per the instructions found here. I created a project using the Polymer Starter Kit (PSK). I named the project my-app . I installed the Github repo found here

dom-repeat template fails to render array with error 'expected array for items'

心不动则不痛 提交于 2020-01-03 12:59:30
问题 I have a simple template that renders an array object. However, it fails with the following message: [dom-repeat::dom-repeat]: expected array for `items`, found [{"code":1,"name":"Item #1"},{"code":2,"name":"Item #2"},{"code":3,"name":"Item #3"}] The array is passed in the attribute of the custom element in the following format: [{"code":1,"name":"Item #1"},{"code":2,"name":"Item #2"},{"code":3,"name":"Item #3"}] I have read the docs on template repeaters several times and still unable to

What are difference between hostAttributes and properties in polymer?

心不动则不痛 提交于 2020-01-02 01:37:06
问题 I'm doing migration from 0.5 to 1.0. While reading, I notice 2 different way on declaring attributes, using hostAttributes and properties . What are difference between those 2 ? 回答1: Host attributes are attributes that do not match to an element's corresponding Javascript property (which you declare in properties ). This includes attributes like class , tabindex , data-* attributes, aria-roles, etc. To declare them during create-time, you must set them in the hostAttributes object. If you are

How do you bind Polymer elements to a Model in ASP.NET

删除回忆录丶 提交于 2020-01-01 17:26:20
问题 I have no problems displaying my model in a View using Polymer, for example: <paper-icon-item> <iron-icon icon="communication:phone" item-icon></iron-icon> <paper-item-body two-line> <div>@Model.PhoneNumber</div> <div secondary>Phone Number</div> </paper-item-body> </paper-icon-item> but I just do not get the bindings right for input //this does not work <paper-input label="Phone Number">@Model.PhoneNumber</paper-input> //nor this <paper-input is="iron-input" label="Phone Number">@Model

How do you bind Polymer elements to a Model in ASP.NET

|▌冷眼眸甩不掉的悲伤 提交于 2020-01-01 17:26:07
问题 I have no problems displaying my model in a View using Polymer, for example: <paper-icon-item> <iron-icon icon="communication:phone" item-icon></iron-icon> <paper-item-body two-line> <div>@Model.PhoneNumber</div> <div secondary>Phone Number</div> </paper-item-body> </paper-icon-item> but I just do not get the bindings right for input //this does not work <paper-input label="Phone Number">@Model.PhoneNumber</paper-input> //nor this <paper-input is="iron-input" label="Phone Number">@Model

How to two-way bind iron-input to dom-repeat's item?

≯℡__Kan透↙ 提交于 2020-01-01 10:05:56
问题 I just started playing with Polymer 1.0 and am trying to do a very simple binding to collection. I am able to display text within dom-repeat, but the two-way binding to iron-input does not work. I tried array of strings, and objects. No luck. <link rel="import" href="bower_components/polymer/polymer.html"> <link rel="import" href="bower_components/iron-input/iron-input.html"> <dom-module id="hello-world"> <template> <ul> <template is="dom-repeat" items="{{data}}"> <li>{{item.value}}</li> <

Paper-dialog shows up behind drawer-panel when placed in a custom element

为君一笑 提交于 2019-12-31 04:44:05
问题 The paper-dialog shows up behind drawer-panel when launched from a custom element. Here's the modified "my-greetings.html" custom element from polymer-starter-kit to show a dialog: <dom-module id="my-greeting"> <style> :host { display: block; } @media (max-width: 600px) { h1.paper-font-display1 { font-size: 24px; } } </style> <template> <paper-dialog id="bigDialog"> <h2>Scrolling</h2> <paper-dialog-scrollable> <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor

How to style a <paper-input> tag in Polymer 1.0

a 夏天 提交于 2019-12-28 05:58:11
问题 How do you style the <paper-input> tag in Polymer 1.0 Can you show how to specifically custom style the label text color, the underline color, input text color, and how to access them using custom-style ? 回答1: You can change the appearance of <paper-input> by changing the custom properties listed over here (The information has been moved for the most recent version - it is available for versions older than v1.1.21). Here's an example: <style is="custom-style"> :root { /* Label and underline

Is it possible to conditionally display element attributes using Angular2? [duplicate]

不打扰是莪最后的温柔 提交于 2019-12-28 05:27:24
问题 This question already has answers here : How to add conditional attribute in Angular 2? (7 answers) Closed 2 years ago . I have some code that uses Polymer attributes on elements, for example: <paper-drawer-panel force-narrow> The way polymer works is that I can't simply say force-narrow="false" if I want to disable the attribute, it has to be removed altogether. Is there a way in Angular2 to conditionally remove the entire attribute? I can't seem to find any information on this topic. I

Polymer 1.0 observers watching a object path is not triggering even though data has changed

妖精的绣舞 提交于 2019-12-25 14:24:50
问题 jsFiddle: https://jsfiddle.net/ghstahl/09tL1ku7/ <script src="https://cdn.rawgit.com/download/polymer-cdn/1.1.3/lib/webcomponentsjs/webcomponents-lite.js"></script> <link rel="import" href="https://cdn.rawgit.com/download/polymer-cdn/1.1.3/lib/polymer/polymer.html"> <link rel="import" href="https://cdn.rawgit.com/download/polymer-cdn/1.1.3/lib/paper-styles/paper-styles.html"> <link rel="import" href="https://cdn.rawgit.com/download/polymer-cdn/1.1.3/lib/paper-styles/color.html"> <link rel=