<html ng-app="animTodo">
<head>
<meta name="description" content="A demonstration of Angular 1.2 with Animate.css" />
<meta charset=utf-8 />
<title>Angular 1.2 and Animate.css</title>
<link rel="stylesheet" href="//djyhxgczejc94.cloudfront.net/frameworks/bootstrap/3.0.0/themes/white-plum/bootstrap.min.css">
<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/animate.css/2.0/animate.min.css">
<script src="http://code.angularjs.org/1.2.0-rc.3/angular.js"></script>
<script src="http://code.angularjs.org/1.2.0-rc.3/angular-animate.js"></script>
</head>
<body ng-controller="TodoCtrl">
<div class="container">
<h1 class="page-header text-center">Animate.css + Angular 1.2</h1>
<form ng-submit="addTodo(newTodo)">
<input type="text" ng-model="newTodo" class="form-control" placeholder="New todo item goes here, then press Enter" focus>
</form>
<br>
<div class="list-group">
<div class="list-group-item todo-item" ng-repeat="item in items" ng-class="{'todo-complete': item.complete}">
<span class="close" ng-click="removeTodo($index)">×</span>
<label>
<input type="checkbox" ng-model="item.complete">
<span ng-bind="item.text">This is the content of the Todo</span>
</label>
</div>
</div>
<button class="btn btn-block btn-danger" ng-click="clearAll()">Clear All Items</button>
</div>
</body>
</html>
.todo-item {
//-webkit-transition: color 0.6s, background-color 0.3s;
//-moz-transition: color 0.6s, background-color 0.3s;
//-ms-transition: color 0.6s, background-color 0.3s;
//transition: color 0.6s, background-color 0.3s;
label {
display: block;
}
&.ng-enter {
animation: fadeInLeft 1s;
animation: fadeInLeft 1s;
animation: fadeInLeft 1s;
animation: fadeInLeft 1s;
}
&.ng-leave {
animation: bounceOut 1s;
animation: bounceOut 1s;
animation: bounceOut 1s;
animation: bounceOut 1s;
}
}
.todo-complete {
background: #f3f3f3;
color: #777;
label {
text-decoration: line-through;
}
}
var app = angular.module("animTodo", ["ngAnimate"]);
app.controller("TodoCtrl", function($scope) {
$scope.items = [{text: "This is a demo todo.", complete: true}];
$scope.newTodo = "";
$scope.addTodo = function() {
$scope.items.push({text: $scope.newTodo, complete: false});
$scope.newTodo = "";
};
$scope.removeTodo = function(index) {
$scope.items.splice(index, 1);
};
$scope.clearAll = function() {
$scope.items = [];
};
});
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. |