File tree 2 files changed +2
-3
lines changed
2 files changed +2
-3
lines changed Original file line number Diff line number Diff line change 1
1
import TodoItemView from "./todo-item-view.js"
2
2
import TodoItem from "./todo-item-model.js"
3
+
3
4
$ ( function ( ) {
4
5
var $form = $ ( '.todoForm' ) ;
5
6
var $list = $ ( '.todoList' ) ;
6
7
7
-
8
8
function createTodoItem ( text ) {
9
9
var model = new TodoItem ( {
10
10
title : text
Original file line number Diff line number Diff line change 3
3
var { View} = Backbone ;
4
4
class TodoItemView extends View {
5
5
constructor ( options ) {
6
- // *... is a list tag.*
7
6
this . tagName = 'li' ;
7
+
8
8
// *Cache the template function for a single item.*
9
9
this . template = _ . template ( `
10
10
<input type="checkbox" class="<%= completed ? 'is-complete' : '' %>" <%= completed ? 'checked' : '' %>>
11
11
<span class="todoText"><%- title %></span>
12
12
<i class="removeBtn fa fa-times"></i>
13
13
` ) ;
14
- this . input = '' ;
15
14
// *Define the DOM events specific to an item.*
16
15
this . events = {
17
16
'click input' : 'toggleComplete' ,
You can’t perform that action at this time.
0 commit comments