<head>
<script src="http://code.jquery.com/jquery-1.11.3.min.js"></script>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.css" />
<script src="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.js"></script>
<script src="http://code.angularjs.org/1.4.8/angular.js"></script>
<script src="https://rawgit.com/angular-ui/ui-router/0.2.11/release/angular-ui-router.js"></script>
</head>
<body ng-app="myApp" class="container">
<div class="row">
<div class="col-md-12">
<div class="well">
</div>
</div>
</div>
<div class="row">
<div class="col-md-12">
<div class="well" ui-view></div>
</div>
</div>
<script type="text/ng-template" id="maintplhtml">
<input type="checkbox" ng-model="vm.isAllCheck" ng-change="vm.toggleIsAllCheck()"/>
<input placeholder="What needs to be done?" ng-model="vm.newTodo" auto2focus enter-new-todo="vm.addTodo()"/>
<ul>
<li ng-repeat="todo in vm.todos|filter:vm.statusFilter track by $index" ng-class="{completed:todo.completed,editing:vm.isTheEdited(todo)}">
<div ng-hide="vm.isTheEdited(todo)">
<input class="toggle" type="checkbox" ng-model="todo.completed">
<label ng-dblclick="vm.editTodo(todo)">{{todo.title}}</label>
<button class="destroy" ng-click="vm.removeTodo(todo)">X</button>
</div>
<input focus-when="vm.isTheEdited(todo)" ng-enter ng-blur="vm.editedTodo=null" current="vm.editedTodo" ng-show="vm.isTheEdited(todo)" ng-trim="false" ng-model="todo.title" todo-escape="revertEditing(todo)" >
</li>
</ul>
<hr>
<div id='todo-count'>
<br> total: <strong ng-bind=" vm.total"></strong>
<br> completed: <strong ng-bind=" vm.completed"></strong>
<br> remaining: <strong ng-bind="vm.remaining"></strong>
</div>
<hr>
<ul id="filters">
<li>
<a ng-click="vm.statusFilter={completed:''}" href="#">All</a>
</li>
<li>
<a ng-click="vm.statusFilter={completed:true}" href="#">Completed</a>
</li>
</ul>
</script>
</body>
</html>
#filters {
margin: 0;
padding: 0;
list-style: none;
right: 0;
left: 0;
}
#filters li {
display: inline;
}
#filters li a {
color: #83756f;
margin: 2px;
text-decoration: none;
}
#filters li a.selected {
font-weight: bold;
}
Output
You can jump to the latest bin by adding /latest
to your URL
Keyboard Shortcuts
Shortcut | Action |
---|---|
ctrl + [num] | Toggle nth panel |
ctrl + 0 | Close focused panel |
ctrl + enter | Re-render output. If console visible: run JS in console |
Ctrl + l | Clear the console |
ctrl + / | Toggle comment on selected lines |
ctrl + ] | Indents selected lines |
ctrl + [ | Unindents selected lines |
tab | Code complete & Emmet expand |
ctrl + shift + L | Beautify code in active panel |
ctrl + s | Save & lock current Bin from further changes |
ctrl + shift + s | Open the share options |
ctrl + y | Archive Bin |
Complete list of JS Bin shortcuts |
JS Bin URLs
URL | Action |
---|---|
/ | Show the full rendered output. This content will update in real time as it's updated from the /edit url. |
/edit | Edit the current bin |
/watch | Follow a Code Casting session |
/embed | Create an embeddable version of the bin |
/latest | Load the very latest bin (/latest goes in place of the revision) |
/[username]/last | View the last edited bin for this user |
/[username]/last/edit | Edit the last edited bin for this user |
/[username]/last/watch | Follow the Code Casting session for the latest bin for this user |
/quiet | Remove analytics and edit button from rendered output |
.js | Load only the JavaScript for a bin |
.css | Load only the CSS for a bin |
Except for username prefixed urls, the url may start with http://jsbin.com/abc and the url fragments can be added to the url to view it differently. |