Skip to content
This repository has been archived by the owner on May 29, 2019. It is now read-only.

Tutorial uses tag-name in Polymer() call inconsistently #608

Closed
rod opened this issue Aug 18, 2014 · 6 comments
Closed

Tutorial uses tag-name in Polymer() call inconsistently #608

rod opened this issue Aug 18, 2014 · 6 comments
Assignees

Comments

@rod
Copy link

rod commented Aug 18, 2014

The section on adding the favoriteTapped method reads:

<script>
  Polymer({
    ...

which won't work. It should read:

<script>
  Polymer('post-card', {
    ...
@addyosmani
Copy link
Member

Could you confirm which version of Polymer you're experiencing this issue with? For certain classes of problems we support both the Polymer({ and Polymer('element-name', { form of registration.

@addyosmani
Copy link
Member

cc @arthurevans

@rod
Copy link
Author

rod commented Aug 19, 2014

Looks like I'm using version 0.3.5

@arthurevans
Copy link

Try it as written. It should work just fine. You can omit the tag name in the Polymer() call in the following circumstances:

  • The <script> tag containing the Polymer() call is inside the <polymer-element> that defines the new element.
  • The Polymer() call is inline (not in an external script).
  • The <polymer-element> is in an HTML import, not the main document.

If all of these circumstances are met, it's cleaner to omit the tag name from the call since it's repetitive and can lead to cryptic errors.

I apologize that this isn't in the docs yet -- I have a PR open to add this but I'm waiting for review from the engineers before merging.

I'm going to keep this open as a reminder to make sure we use or omit tag names consistently in the tutorial, since it's kind of messy ATM.

@arthurevans arthurevans changed the title Step 4 is missing a bit of instruction Tutorial uses tag-name in Polymer() call inconsistently Aug 19, 2014
@arthurevans
Copy link

Renaming this to make it more descriptive.

@arthurevans
Copy link

As of 0.4.0, the inferred tag name in the Polymer() call is supported nearly everywhere. Docs are updated here:

http://www.polymer-project.org/docs/polymer/polymer.html#altregistration

And the tutorial text and repo should only be using the form without the tag-name argument.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants