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

Code Errors in the tutorial #451

Closed
markbarton opened this issue Jun 26, 2014 · 4 comments
Closed

Code Errors in the tutorial #451

markbarton opened this issue Jun 26, 2014 · 4 comments

Comments

@markbarton
Copy link

I am new to Polymer so I went through the tutorial and found the following problems:

Step 2.

The description indicates there are 3 import in the starter file for post-card.html, in fact there are only 2. The 3rd file is not required at this step but is used later (its the paper-icon-button).

The example markup given further down the page doesn't have the surrounding DIV so the Postcard takes up the whole width.

Currently

<post-card>
    <img width="70" height="70" 
      src="../images/avatar-07.svg">
      <h2>Another Developer</h2>
      <h3>I'm composing with shadow DOM!</h3>
    </post-card>

Should be

<div layout vertical center>
<post-card>
    <img width="70" height="70" 
      src="../images/avatar-07.svg">
      <h2>Another Developer</h2>
      <h3>I'm composing with shadow DOM!</h3>
    </post-card>
</div>

Step 3.

The example code which describes inserting the repeating post-cards appears to be within the post-service. The post-service needs to be closed.

Currently

<post-service id="service" posts="{{posts}}">
<div layout vertical center>
  <template repeat="{{post in posts}}">
    <post-card>
      <img src="{{post.avatar}}" width="70" height="70">
      <h2>{{post.username}}</h2>
      <p>{{post.text}}</p>
    </post-card>
  </template>
</div>

Should be

<post-service id="service" posts="{{posts}}"></post-service>
<div layout vertical center>
  <template repeat="{{post in posts}}">
    <post-card>
      <img src="{{post.avatar}}" width="70" height="70">
      <h2>{{post.username}}</h2>
      <p>{{post.text}}</p>
    </post-card>
  </template>
</div>
@ScottBeeson
Copy link

I beat you to it ;)

#448
and
googlearchive/polymer-tutorial#1

edit: but you have a couple additional issues.

@bwiggs
Copy link

bwiggs commented Jun 26, 2014

+1 to the Step 3 issue you found. I spent a while trying to figure out what I missed.

Correct:

<post-service id="service" posts="{{posts}}"></post-service>
<div layout vertical center>

Wrong:

<post-service id="service" posts="{{posts}}">
<div layout vertical center>

@arthurevans
Copy link

Thanks and apologies -- I spent a while trying to figure out how I missed this: unescaped angle bracket in the markup meant the closing tag didn't show up. Will fix this today.

@arthurevans
Copy link

Fixed. Docs and tutorial repo are updated.

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

5 participants