."/> ."/> "/>
خرید بک لینک

Vote count: 0

How can I use getElementById in a Polymer custom element?

Here is my element:

<link rel="import" href="../bower_components/polymer/polymer.html">
<link rel="import" href="../styles/shared-styles.html">

<dom-module id="bb-calendar">

  <template>

    <style is="custom-style" include="shared-styles"></style>

    <div class="card">
            <paper-toolbar>
                <div title>Calendar</div>
            </paper-toolbar>
            <div id="hidene">
                <div>this should be hidden</div>
            </div>
    </div>

  </template>

  <script>

    Polymer({

      is: 'bb-calendar',

      ready: function() {
        document.getElementById("hideme").style.display = 'none';
      }

    });

  </script>

</dom-module>

When I run the code I get this error message: Uncaught TypeError: Caot read property 'style' of null

Obviously I'm doing something wrong but I don't know what.

Thanks, Zvi

asked 1 min ago

برچسب: نویسنده: استخدام کار تاريخ: دوشنبه 4 مرداد 1395 ساعت: 15:36

صفحه بندی