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://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.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.6/ember.min.js"></script>
  <script src="https://rawgithub.com/ebryn/ember-model/master/ember-model.js"></script>
    </head>
<body>
  
  <!-- Application template -->
    <script type="text/x-handlebars">
    <div class="outer">
        {{outlet}}
    </div>
    </script>
    <!-- All posts -->
    <script type="text/x-handlebars" data-template-name="posts">
    <div class="header-bar">
        <div class="header-bar__primary-action">
            {{#linkTo 'posts.new' class="fill-hit"}}
                New
            {{/linkTo}}
        </div>
        <div class="header-bar__title">
            {{#linkTo 'index'}}View all{{/linkTo}}
        </div>
    </div>
    {{outlet}}
    </script>
    <script type="text/x-handlebars" data-template-name="posts/index">
    <div class="posts">
        {{#each controller}}
        <div class="posts__item">
            {{#linkTo 'post' this}}{{title}}{{/linkTo}}
        </div>
        {{/each}}
    </div>
    </script>
    <script type="text/x-handlebars" data-template-name="posts/new">
    <form {{action savePost on="submit"}} class="new-post">
        {{view Ember.TextArea valueBinding="controller.title" placeholder="Enter your post here"}}
        <button type="submit">Save</button>
    </form>
    </script>
    <script type="text/x-handlebars" data-template-name="post">
    <p>{{title}}</p>
    {{#linkTo 'comments' this}}View comments{{/linkTo}}
    {{outlet}}
    </script>
    <script type="text/x-handlebars" data-template-name="comments">
    Comments:
    <ul>
        {{#each controller}}
            <li class="comment">- {{text}}</li>
        {{/each}}
    </ul>
    {{#linkTo 'comments.new' this}}Add comment{{/linkTo}}
    {{outlet}}
    </script>
    <script type="text/x-handlebars" data-template-name="comments/new">
    <form {{action saveComment on="submit"}} class="new-comment">
        {{view Ember.TextField valueBinding="controller.text" placeholder="Add your comment"}}
        <button type="submit">Add</button>
    </form>
    </script>
  
</body>
</html>
Output

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

Dismiss x
public
Bin info
joecritchpro
0viewers