Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot get the sample composed view to work #14

Closed
lmartins opened this issue Apr 22, 2014 · 3 comments
Closed

Cannot get the sample composed view to work #14

lmartins opened this issue Apr 22, 2014 · 3 comments

Comments

@lmartins
Copy link

Hi, im now following the docs to learn the essentials of Ripple but im stuck on the following code.

events      = require "events"
each        = require "each"
dispatch    = require "dispatch"
ripple      = require 'ripple'

Avatar = ripple 'Avatar: {{username}}'
Link = ripple 'Link: {{username}}'

Profile = ripple('#profileTemplate')
  .compose 'profile-avatar', Avatar
  .compose 'profile-link', Link

profile = new Profile
  data:
    username: 'lmartins'

profile.appendTo document.body

Im referencing a template that I have on my document, like this:

<script type="text/template" charset="utf-8" id="profileTemplate">
      <div class="Profile">
        <profile-avatar username="{{username}}"></profile-avatar>
        <profile-link username="{{username}}"></profile-link>
      </div>
    </script>

In runtime this outputs:

<div class="Profile">
        Avatar: lmartins
        <profile-link username="{{username}}"></profile-link>
      </div>

Any ideia why the second custom-element isn't being outputting anything?

@anthonyshort
Copy link
Contributor

Bump to 0.3.3, that bug was fixed :)

@anthonyshort
Copy link
Contributor

You can do multi-line strings in CS too, which should make it super easy to just do inline templates in your components if that's your thing

@lmartins
Copy link
Author

Nice, updated and solved. Tks Anthony.
Thanks for tip on multiline string from CS. I knew about them but didn't occur to me. Will become handy if I end up using a build system other than Component.

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

No branches or pull requests

2 participants