We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I have tested the below and it works fine. You can move piece by piece.
diff --git a/sensor-tester/src/create-page.js b/sensor-tester/src/create-page.js new file mode 100644 index 0000000..727783c --- /dev/null +++ b/sensor-tester/src/create-page.js @@ -0,0 +1,16 @@ +import {LitElement, html, property} from '@polymer/lit-element'; + +export const createPage = (options) => { + return class extends LitElement { + render() { + return html` + <sensor-tests-page + tests=${options.src} + sensortype=${options.sensorType} + referenceframe=${options.sensorType || "screen"} + frequency=${options.frequency || 90}> + </sensor-tests-page> + `; + } + } +} \ No newline at end of file diff --git a/sensor-tester/src/sensor-tester.html b/sensor-tester/src/sensor-tester.html index 07257b3..ab04c2e 100644 --- a/sensor-tester/src/sensor-tester.html +++ b/sensor-tester/src/sensor-tester.html @@ -13,7 +13,6 @@ <link rel="import" href="../bower_components/paper-icon-button/paper-icon-button.html"> <link rel="lazy-import" href="accelerometer-page.html"> -<link rel="lazy-import" href="accelerometer-screen-page.html"> <link rel="lazy-import" href="linearaccelerationsensor-page.html"> <link rel="lazy-import" href="linearaccelerationsensor-screen-page.html"> <link rel="lazy-import" href="gyroscope-page.html"> @@ -22,6 +21,15 @@ <link rel="lazy-import" href="ambientlightsensor-page.html"> <link rel="lazy-import" href="magnetometer-page.html"> +<script type="module"> + import { createPage } from "create-page.js" + + customElements.define('accelerometer-screen-page', createPage({ + src: "src/tests/accelerometer-screen.json", + sensorType: "Accelerometer" + })); +</script> + <dom-module id="sensor-tester"> <template> <style>
The text was updated successfully, but these errors were encountered:
@kaixinjxq
Sorry, something went wrong.
You probably don't want to create the pages (which involves loading json etc) before the router requests it
Btw, I might be able to work on some of this tomorrow - there is a lot of things that could be improved
#60
No branches or pull requests
I have tested the below and it works fine. You can move piece by piece.
The text was updated successfully, but these errors were encountered: