0

how to send a data to another page(without using local-storage) by an onclick function using polymer 1.0?

The code is given below.

I want to send a data named 'categoryid' taken from this page to another page named 'category.html' shown below submenu-list.html.I want to access the data 'categoryid' to the page category.html.

Kindly provide a clear solution by editing the code.

/* Page name - submenu-list.html */

<link rel="import" href="../../bower_components/polymer/polymer.html">
 <dom-module id="submenu-list">
  <template>
    <paper-menu>
      <paper-item><a href="/home/catalogue" onclick="response">My Menu Items</a></paper-item>
    </paper-menu>
  </template>
  <script>
    Polymer({
     is:'submenu-list',
     properties: {
        categoryid: {
          type: Number,
          value:''
        }
     },
     response: function() {

     }
})
  </script>
 </dom-module>

/* Page name - category.html */

<link rel="import" href="../../bower_components/polymer/polymer.html">
 <dom-module id="category">
  <template>

  </template>
  <script>
    Polymer({
     is:'category',
})
  </script>
 </dom-module>
Subhojit
  • 1,389
  • 8
  • 19
  • 33
  • The href tag points to `home/catalogue`, and you also want to send data to category web component? – Santosh Jun 05 '17 at 12:27
  • Actually, the home/catalogue you are watching is the the route to category.html file. I just want to send the data 'categoryid' to the category.html and want to access that data in that page (without using the local storage). – Subhojit Jun 06 '17 at 04:27
  • If `home/catalogue` is route to category page, then why cannot you send id in url itself. Like `home/catalogue/123` – Santosh Jun 06 '17 at 04:29
  • I have tried that too. I have sent the id in the url but the component should be loaded (not the whole page) each time clicking on the link. – Subhojit Jun 06 '17 at 04:52
  • Clicking on the link is just setting the url. not loading the component. – Subhojit Jun 06 '17 at 04:54

0 Answers0