polymer-starter-kit

Polymer 1.0 App-Drawer - Uncaught TypeError when not rendered via dom-if

蓝咒 提交于 2020-01-07 02:01:32
问题 Displaying the menu only to members I've got this bit of code <app-drawer-layout fullbleed> <!-- Drawer content --> <template is="dom-if" if="{{signedIn}}"> <app-drawer> .... This displays the menu only when users are logged in to the application. It works fine but is there anyway to remove the error it causes in the console. error: polymer-mini.html:2046 Uncaught TypeError: Cannot read property 'getWidth' of undefined 回答1: The layout logic in <app-drawer-layout> requires an <app-drawer> to

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

喜欢而已 提交于 2020-01-03 16:25:43
问题 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

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

How can I swipe between tabs using Polymer 1.0?

随声附和 提交于 2019-12-24 16:12:16
问题 I am using Polymer 1.0 and looking to create a tabbed layout where I can swipe between each tab I have. I have found a swipe-pages component, but the dependencies on the site state that it needs "polymer": "Polymer/polymer#^0.4.0" which does not work with the rest of my application. Are there any other components compatible with the latest version of Polymer (or at least Polymer 1.0)? Thanks 回答1: There is a Polymer 1.0 version. See https://github.com/slogger/swipe-pages. 回答2: I'm very new in

Hosting Polymer app on web server with base URLs

倾然丶 夕夏残阳落幕 提交于 2019-12-23 19:15:30
问题 If I take the Polymer starter kit, it works well locally. I can navigate to http://localhost:8080/ and all the links to the 3 views work fine. Now, if I host this app on a web server (that is shared with other apps) on a URL such as http://myservername:8080/mywonderfulapp/, I am having trouble with the routing. Is there a way I can mention the app-route to take in the relative URL? I tried making changes to the html files to have relative URLs <link rel="import" href="./src/my-app.html"> <a

How to access functions defined in js file inside the template of Polymer element?

青春壹個敷衍的年華 提交于 2019-12-23 06:06:33
问题 I have created a function in global.function.js file as function getData(flag) { if (flag === 1) { return "one"; } else { return "not one"; } } which then is imported using custom-js-import.html element: <script src="global.function.js"></script> When I tried to access the above function in custom-element.html , I am able to access it in the script part but not in the template part. Is there any way I can access the function inside the HTML element? <!-- custom-element.html --> <link rel=

How to access functions defined in js file inside the template of Polymer element?

梦想的初衷 提交于 2019-12-23 06:06:14
问题 I have created a function in global.function.js file as function getData(flag) { if (flag === 1) { return "one"; } else { return "not one"; } } which then is imported using custom-js-import.html element: <script src="global.function.js"></script> When I tried to access the above function in custom-element.html , I am able to access it in the script part but not in the template part. Is there any way I can access the function inside the HTML element? <!-- custom-element.html --> <link rel=

Possible to have multiple `manifest.json` for PWA?

被刻印的时光 ゝ 提交于 2019-12-21 12:34:15
问题 Consider I have:- PWA at myapp.firebaseapp.com with it's own manifest.json . Admin for the PWA at myapp.firebaseapp.com/admin Is it possible to have another manifest.json for the admin URL to allow "Add to Home Screen" on the same PWA? 回答1: Sure; the manifest for a given page is determined by the presence of a DOM element with details about the manifest's location. Assuming you have full control over the HTML for /admin and for all other pages, you can include <link rel="manifest" href="/path

Polymer deactivating pages when their not in view

▼魔方 西西 提交于 2019-12-21 09:29:20
问题 I'm using the polymer application drawer template from the polymer cli. I'm having some trouble with: When you load a new page, the html element is imported; then it's code executes When I move to another page the code for the previous page is still running. Is there a way to destroy and create the page/element or suspend and enable? Whats the best practice for dealing with this problem? Have the pages implement a create and destroy method and invoke it when changing page? Ie oldPageElement

Polymer deactivating pages when their not in view

可紊 提交于 2019-12-21 09:28:09
问题 I'm using the polymer application drawer template from the polymer cli. I'm having some trouble with: When you load a new page, the html element is imported; then it's code executes When I move to another page the code for the previous page is still running. Is there a way to destroy and create the page/element or suspend and enable? Whats the best practice for dealing with this problem? Have the pages implement a create and destroy method and invoke it when changing page? Ie oldPageElement