Skip welcome & menu and move to editor
Welcome to JS Bin
Load cached copy from
 
<!DOCTYPE html>
<html>
<head>
<meta charset=utf-8 />
<title>JS Bin</title>
  <script src="http://code.jquery.com/jquery-1.9.1.js"></script>
  <script src="http://cdnjs.cloudflare.com/ajax/libs/handlebars.js/1.0.0-rc.3/handlebars.js"></script>
  <script src="http://cdnjs.cloudflare.com/ajax/libs/ember.js/1.0.0-rc.2/ember.js"></script>
</head>
<body>
  <script type="text/x-handlebars" data-template-name="index">
  <button {{action addPost}}>add post</button>
  <button {{action addBookmark}}>add bookmark</button>
  <button {{action addPhoto}}>add photo</button>
  
  <table>
    <tr>
      <td>
      unsorted:
      <ul>
      {{#each item in controller.stream}}
          {{#if item.isPost}}
            <li>post: {{item.name}} {{item.publishtime}}</li>
          {{/if}}
          {{#if item.isBookmark}}
            <li>bookmark: {{item.name}} {{item.publishtime}}</li>
          {{/if}}
          {{#if item.isPhoto}}
            <li>photo: {{item.name}} {{item.publishtime}}</li>
          {{/if}}
      {{/each}}
       </ul>
  </td>
  <td>
     sorted:
     <ul>
    {{#each item in controller.streamSorted}}
        {{view App.StreamItemView contentBinding=item}}
    {{/each}}
     </ul>
  </td>
  </tr>
  </table>
</script>
  
  
<script type="text/x-handlebars" data-template-name="StreamItemPost">
  post: {{view.content.name}} {{view.content.publishtime}}
</script>
  
<script type="text/x-handlebars" data-template-name="StreamItemBookmark">
  bookmark: {{view.content.name}} {{view.content.publishtime}}
</script>
  
<script type="text/x-handlebars" data-template-name="StreamItemPhoto">
  photo: {{view.content.name}} {{view.content.publishtime}}
</script>
</body>
</html>
Output

You can jump to the latest bin by adding /latest to your URL

Dismiss x
public
Bin info
anonymouspro
0viewers