Skip welcome & menu and move to editor
Welcome to JS Bin
Load cached copy from
 
<!DOCTYPE html>
<html>
<head>
<meta name="description" content="Ember.js - Why the filter method is called when we go to index?" />
<meta charset=utf-8 />
<title>JS Bin</title>
<script src="http://code.jquery.com/jquery-2.0.2.js"></script>
<script src="http://cdnjs.cloudflare.com/ajax/libs/handlebars.js/1.0.0/handlebars.js"></script>
<script src="http://builds.emberjs.com/beta/ember.js"></script>
<script src="http://builds.emberjs.com/beta/ember-data.js"></script>
</head>
<body>
  <script type="text/x-handlebars" data-template-name="application">
  {{#link-to 'posts'}} Go to Posts {{/link-to}}
  {{outlet}}
  </script>
  
  <script type="text/x-handlebars" data-template-name="posts/index">
      <h2>index</h2>
      {{#each}}
        {{title}} <br>
      {{/each}}
      {{#link-to "posts.active"}}Go to Active{{/link-to}}
    </script>
  
  <script type="text/x-handlebars" data-template-name="posts/active">
      <h2>Active</h2>
      {{#each item in filteredPosts}}
        {{item.title}} <br>
      {{/each}}
      {{#link-to "posts.index"}}Go to Index{{/link-to}}
    </script>
    </body>
</html>
Output

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

Dismiss x
public
Bin info
kingpin2kpro
0viewers