Error if we do not use an attribute

90 views
Skip to first unread message

tge...@berkeley.edu

unread,
Nov 8, 2014, 7:38:39 AM11/8/14
to polym...@googlegroups.com
Hi,

I do not really know if I have to put this here, and maybe you already know this but if we put an attribute in "attributes" inside the <polymer-element>, and if we do not use it after in the template, there is an error in Internet Explorer, Safari and Firefox. And thus, the application is not loaded.
(At least for id, and title)

Example :

<link rel="import" href="../../bower_components/polymer/polymer.html">
<polymer-element name="test-element" attributes="id title">
  <template>
    <link rel="stylesheet" href="test-element.css">
    foo
  </template>
  <script>
    (function () {
      'use strict';
      Polymer({
        // define element prototype here
      });
    })();
  </script>
</polymer-element>

ID : [Error] TypeError: undefined is not an object (evaluating 'n(this).id') (fonction anonyme) (platform.js, line 13)
Title : TypeError: undefined is not an object (evaluating 'this.__impl4cf1e782hg__.title')

Kind regards,
Thibaut

Message has been deleted

santiago esteva

unread,
Nov 8, 2014, 11:32:47 PM11/8/14
to polym...@googlegroups.com
The docs state Avoid defining a property or method with the same name as a native DOM property or method, such as id, children, focus, title and hidden; the results are unpredictable.

Swap those attribute names and it should be ok

Reply all
Reply to author
Forward
0 new messages