angular #1

Merged
merged 2 commits into from Jan 13, 2012
View
3 README.md
@@ -16,6 +16,7 @@ other forks of the repo.
* [ember.js](http://emberjs.com/)
* [batman.js](http://batmanjs.org/)
* [spine.js](http://spinejs.com/)
+ * [angular.js](http://angularjs.org/#/)
* [JavaScriptMVC](http://javascriptmvc.com/)
2. Load the JavaScripts you'll need in `index.html`
@@ -26,7 +27,7 @@ other forks of the repo.
get at the default HTML template for the main application view, you might do this with jQuery:
``` javascript
- $('#app-template').html();
+ $('#item-template').html();
```
From that point, most JavaScript app frameworks have a facility or convention for applying client-side templates.
View
32 index.html
@@ -19,27 +19,25 @@
</head>
<body>
- <script type="text/template" id="app-template">
- <div id="todoapp">
- <div class="title">
- <h1>Todos</h1>
+ <div id="todoapp">
+ <div class="title">
+ <h1>Todos</h1>
+ </div>
+ <div class="content">
+ <div id="create-todo">
+ <input id="new-todo" placeholder="What needs to be done?" type="text" />
+ <span class="ui-tooltip-top" style="display:none;">Press Enter to save this task</span>
</div>
- <div class="content">
- <div id="create-todo">
- <input id="new-todo" placeholder="What needs to be done?" type="text" />
- <span class="ui-tooltip-top" style="display:none;">Press Enter to save this task</span>
- </div>
- <div id="todos">
- <ul id="todo-list"></ul>
- </div>
- <div id="todo-stats"></div>
+ <div id="todos">
+ <ul id="todo-list"></ul>
</div>
+ <div id="todo-stats"></div>
</div>
+ </div>
- <ul id="instructions">
- <li>Double-click to edit a todo.</li>
- </ul>
- </script>
+ <ul id="instructions">
+ <li>Double-click to edit a todo.</li>
+ </ul>
<script type="text/template" id="item-template">
View
6 spec/todos-spec.js
@@ -17,7 +17,7 @@ window.todoAppDriver = {
};
$(function() {
- describe("A humble to-do application", function() {
+ describe("A humble to-do application", function() {
describe("adding a todo", function() {
var TODO_TEXT = "hug Matt Yoho";
beforeEach(function() {
@@ -70,6 +70,10 @@ $(function() {
}
});
});
+
+ afterEach(function(){
+ $('#new-todo').val('')
+ });
});