javascript-todo-list-tutorial
Version:
Learn how to build a Todo List in JavaScript following Test Driven Development TDD!
35 lines (33 loc) • 1.3 kB
HTML
<html lang=”en-GB” data-framework="javascript">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="viewport"
content="width=device-width, initial-scale=1.0, user-scalable=yes">
<title>TodoMVC Todo List Example in VanillaJS!</title>
<link rel="shortcut icon"
href="lib/favicon.ico" type="image/x-icon">
</head>
<body>
<div id="app"></div>
<!-- CSS Styles are 100% optional. but they make it look *much* nicer -->
<link rel="stylesheet" href="lib/todomvc-common-base.css">
<link rel="stylesheet" href="lib/todomvc-app.css">
<script src="lib/elmish.js"></script>
<script src="lib/todo-app.js"></script>
<script>
var model = {
todos: [
// { id: 0, title: "Make something people want.", done: false },
// { id: 1, title: "Bootstrap for as long as you can", done: false },
// { id: 2, title: "Let's solve our own problem", done: false }
],
hash: '#/', // the "route" to display
// editing: 2 // edit the 3rd todo list item (which has id == 2)
};
mount(model, update, view, 'app', subscriptions);
</script>
<!-- Below this point is all related to the Tests for the App -->
<div id="test-app"></div> <!-- Create a test-app div to mount the app -->
</body>
</html>