Skip to content

Instantly share code, notes, and snippets.

@alexdiliberto
Created January 15, 2018 16:33
Show Gist options
  • Save alexdiliberto/738ccb7ab3d26aca5a7e5032a334c475 to your computer and use it in GitHub Desktop.
Save alexdiliberto/738ccb7ab3d26aca5a7e5032a334c475 to your computer and use it in GitHub Desktop.
Presentational UI Component Architecture in Ember
{{!--
  Create a `/components/ui` directory to keep all of the ui presentational components

  In this example `ui-card` and `ui-selectable-list` are both simply presentational contextual components
--}}
{{#ui-card as |card|}}
  {{#card.header onClose=onClose}}
    Tags
  {{/card.header}}

  {{#card.body}}
    {{#ui-selectable-list as |list|}}
      {{#each tags as |tag|}}
        {{#list.item selected=(contains tag post.tags) onClick=(perform toggleTag tag)}}
          {{tag.name}}
        {{/list.item}}
      {{/each}}
    {{/ui-selectable-list}}
  {{/card.body}}
{{/ui-card}}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment