polymer

Polymer 1.x: Observers

一世执手 提交于 2019-12-06 16:15:22
问题 Ultimately, I want to select individual states from this geochart. But this question is limited to getting the observer labeled _computeData to fire in response to mutating the array of selected states. Reproduce the problem with the following steps: Open this jsBin. Clear the console. Select the state of Texas. Note the console reads: You selected: Colorado,South Dakota,Texas which is expected per this line: console.log('You selected: ' + this.selected); // Logs properly However, I expect

Polymer: Uncaught TypeError: Cannot read property 'persistent' of undefined

主宰稳场 提交于 2019-12-06 15:20:55
when I try to hide drawer in Login page it occur error. I use dom-if for hiding menubar and according to it's syntax I used <template> tag. But it occur error. Polymer code <!-- Drawer content --> <template is="dom-if" if="[[_isLogin()]]"> <app-drawer id="drawer" slot="drawer" swipe-open="[[narrow]]"> <app-toolbar>Menu</app-toolbar> <iron-selector selected="[[page]]" attr-for-selected="name" class="drawer-list" role="navigation"> <a name="homepage" href="[[rootPath]]homepage">Homepage</a> <a name="profile" href="[[rootPath]]profile">Profile</a> <a name="temp" href="[[rootPath]]temp">Temp</a> <

how to bind polymer custom element to the contents?

删除回忆录丶 提交于 2019-12-06 14:21:19
问题 I'm trying to create an element which has a dynamic number of tabs depending on what content is given to the element. The only way I've figured out how to do this is in JS but I have a feeling this isn't the Polymer way, what am I missing? Can you point me to some docs or other elements that will help me get started? here's what I have so far: Using my custom element <code-file-set> <a href="#" tabTitle="onelink">onelink</a> <a href="#" tabTitle="twolink">twolink</a> <a href="#" tabTitle=

polymer duplicate element content

穿精又带淫゛_ 提交于 2019-12-06 14:16:11
问题 I want to create custom element that displays its content, if content is tapped it will be displayed in paper-dialog. I have: <paper-element name="my-element"> <template> <div vertical layout center on-tap="{{contentClicked}}"> <content></content> </div> <paper-dialog id="dialog"> <content></content> </paper-dialog> </template> <script> Polymer({ contentClicked: function(){ this.$.dialog.toggle(); } }); </script> </paper-element> Content is added only to first div, not to paper-dialog. Is

“Corrupted Content Error” on Firefox with Polymer/Firebase

时光怂恿深爱的人放手 提交于 2019-12-06 13:53:46
问题 I have a Polymer app with service workers hosted with Firebase. The app works fine on every browser except Firefox. When you try to refresh the browser in Firefox after initial load (which works), it throws the following error: A ServiceWorker passed a redirected Response to FetchEvent.respondWith() while RedirectMode is not ‘follow’ The service-worker.js is auto-generated by the polymer-cli (v0.16.0). 回答1: To address this known issue, set the redirect option to follow in your service worker

Polymer 1.0 paper-submenu(s) inside paper-menu

不问归期 提交于 2019-12-06 13:35:46
Then I select an item in my outer paper-menu and after that I navigate into my submenu and select an item there, the outer-item is still selected. also conversely: <paper-menu class="list" attr-for-selected="data-route" selected="[[route]]" selectable="a"> <a data-route="one" href="{{baseUrl}}"> <iron-icon icon="home"></iron-icon> <span>one</span> </a> <paper-submenu> <paper-item class="menu-trigger">two</paper-item> <paper-menu class="menu-content"> <a data-route="two-1" href="{{baseUrl}}two-1"> <paper-item> <iron-icon icon="home"></iron-icon> <span>two 1</span> </paper-item> </a> <a data

Javascript: Converting Object of Objects to Array of Objects

只谈情不闲聊 提交于 2019-12-06 13:24:39
I'm working on a project using Polymer 1.0 and I want to use dom-repeat to list data from Firebase 3.0. In Firebase I have an object of objects like this: var objectofobjects = { "-KR1cJhKzg9uPKAplLKd" : { "author" : "John J", "body" : "vfdvd", "time" : "September 6th 2016, 8:11", "title" : "vfvfd" }, "-KR1cLZnewbvo45fDnEf" : { "author" : "JJ", "body" : "vfdvdvf", "time" : "September 6th 2016, 8:11", "title" : "vfvfdvfdv" } }; and I want to convert it to an array of objects like this: var arrayofobjects = [ { '-KR1cJhKzg9uPKAplLKd': { author: 'John J', body: 'vfdvd', time: 'September 6th 2016,

Polymer 1.0 Data binding when object changes

馋奶兔 提交于 2019-12-06 12:28:16
问题 I'm having trouble understanding how data-binding works now. On my index page I've got an object (obtained as JSON from a RESTful service), which works just fine when applied to a custom element like: <main-menu class="tiles-container ofvertical flex layout horizontal start" menuitems="{{menuitems}}"> </main-menu> var maintemplate = document.querySelector('#fulltemplate'); maintemplate.menuitems = JSON.parse(data.GetDesktopResult); This works as expected, and when I load my page with

Where is it best to handle the business logic in my Polymer app?

蹲街弑〆低调 提交于 2019-12-06 12:16:43
问题 So I've got a pure Polymer app. Currently, in some elements I have methods that call to my Firebase database, and handle related processing and whatnot, which I then <template repeat=...> into my element. This doesn't seem right, as it's encouraged that Polymer elements are reusable. I also do things like dependency injection e.g. <my-element app="{{app}}"> so I have access to global settings and such. What I end up with is a structure like: index.dart -> <my-app-as-an-element app=... ->

Polymer 2.x iron-list slots and data binding

允我心安 提交于 2019-12-06 11:56:58
问题 Has anyone had any success with using a slot in an iron-list? I can get the dom elements to show up in the slot but can't figure out how to do the data binding part. I am filling the slot with some elements that refer to the iron-list's item property with data bindings. Example: component-with-list: <dom-module id="component-with-list"> <template> <iron-list items="{{listData}}" as="item"> <template> <div> <div>[[item.name]]</div> </div> <slot name="listitem"></slot> </template> </iron-list>