Skip welcome & menu and move to editor
Welcome to JS Bin
Load cached copy from
 
<!DOCTYPE html>
<html>
<head>
<meta name="description" content="EMBER-MODEL LIB" />
<script src="http://code.jquery.com/jquery.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/handlebars.js/1.0.0-rc.4/handlebars.js"></script>
<script src="http://builds.emberjs.com.s3.amazonaws.com/ember-1.0.0-rc.6.js"></script>
  
<script src="https://raw.github.com/ebryn/ember-model/master/ember-model.js"></script>
<script src="https://raw.github.com/ebryn/ember-model-localstorage-adapter/master/ember-model-localstorage-adapter.js"></script>
<meta charset=utf-8 />
<title>JS Bin</title>
</head>
<body>
  
<script type="text/x-handlebars">
  This is the application template {{#linkTo 'departments'}}Department{{/linkTo}}<br/>
  {{outlet}}
</script>
  <script type="text/x-handlebars" data-template-name="departments">
  DEPARTMENTS<br/>
  {{#linkTo 'new'}}NEW{{/linkTo}}<br>
  {{#each department in model}}
      
     {{#linkTo 'department' department}}{{department.id}} = {{department.name}}{{/linkTo}}<br> 
  {{/each}}<br> 
  {{outlet}}
</script>
<script type="text/x-handlebars" data-template-name="edit">  
  DEPARTMENT/EDIT<br/>
  {{view Ember.TextField valueBinding=name}}
  <a  href="" {{action 'save' department}}>Save</a>
</script>
<script type="text/x-handlebars" data-template-name="department">  
  {{id}} = 
  {{mname}}
  <br>
  {{#linkTo "departments"}}←All Departments{{/linkTo}}
{{#linkTo "edit" model}}Edit{{/linkTo}}
<a href="#" {{action "destroy"}}>Destroy</a>
  </script>
</body>
</html>
Output

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

Dismiss x
public
Bin info
7alexanderpro
0viewers