0

I am trying to set property for my custom tag. But it gives error instead. I am attaching screenshot of error and code snippet also.

 <awts-est  data-url$="{{dataUrl}}"></awts-est>
properties: {
dataUrl: {
                type: String,
                value: '',
                reflectToAttribute: true,
            },
}

in demo/index.html

 <awtt-ch data-url="http://abc.asdfg.com"></awtt-ch>
Ankita
  • 289
  • 4
  • 16

1 Answers1

2

Ok, I went back through and recreated your build. I believe this is what you have at base level. This was successfully printing off the data from dataUrl.

index.html

<html>
    <head>
        <script src="bower_components/webcomponentsjs/webcomponents-lite.min.js"></script>
        <link href="elements/awtt-ch.html" rel="import">
    </head>
    <body>
        <awtt-ch data-url="http://abc.asdfg.com"></awtt-ch>
    </body>
</html>

elements/awtt-ch.html

<head>
    <link href="../bower_components/polymer/polymer.html" rel="import">
    <link href="/elements/awts-est.html" rel="import">
</head>

<dom-module id="awtt-ch">
   <template>
       <awts-est  data-url$="{{dataUrl}}"></awts-est>
   </template>
</dom-module>

<script>
    Polymer({
        is: "awtt-ch",
        properties: {
            dataUrl: {
                type: String,
                notify: true,
             }
         }      
   });
</script>

elements/awts-est.html

<html>
    <head>
        <link href="../bower_components/polymer/polymer.html" rel="import">
        <link href="/elements/awts-est.html" rel="import">
</head>

<dom-module id="awts-est">
    <template>
        <h1>Here's your data: <span>{{dataUrl}}</span></h1>
    </template>
</dom-module>

<script>
    Polymer({
        is: "awts-est",
            properties: {
                 dataUrl: {
                     type: String,
                     notify: true,
                 }
             }      
    });
 </script>
  • I'll take a look tomorrow when I get to the office and write you a little script. Also, just to clarify and are suppose to be different elements, correct? – Charlie Kelmeckis Mar 01 '17 at 08:51
  • Anky I went back and updated my answer. That should be working, it was on my end. I'm not sure what was going on without seeing all your code, but this is a working template for you to play off of. Let me know if you need anything else! – Charlie Kelmeckis Mar 01 '17 at 14:47
  • I'm really thankful to you. I am trying with this code. – Ankita Mar 02 '17 at 05:22