Skip to content

Commit 51cbd07

Browse files
committed
feat(playground): update todo app to match latest release
1 parent bed094f commit 51cbd07

File tree

6 files changed

+18
-16
lines changed

6 files changed

+18
-16
lines changed

playground/app/components/add-todo.html

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
<form name="ctrl.addTodoForm" novalidate ng-submit="ctrl.addTodo($event, ctrl.label);" element-ready>
1+
<form name="$ctrl.addTodoForm" novalidate ng-submit="$ctrl.addTodo($event, $ctrl.label);" element-ready>
22

33
<div>
44

55
<div class="mdl-textfield mdl-js-textfield mdl-textfield--floating-label">
6-
<input class="mdl-textfield__input" type="text" id="sample3" ng-model="ctrl.label">
6+
<input class="mdl-textfield__input" type="text" id="sample3" ng-model="$ctrl.label">
77
<label class="mdl-textfield__label" for="sample3">What needs to be done?</label>
88
</div>
99
<!-- Accent-colored raised button with ripple -->

playground/app/components/todo-app.html

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11
<h1>Todos yo!</h1>
22

3-
<h3>Todo List remaining: {{ ctrl.todos | remainingTodos }}</h3>
3+
<h3>Todo List remaining: {{ $ctrl.todos | remainingTodos }}</h3>
44

5-
<add-todo on-add="ctrl.createTodo(todo)"></add-todo>
5+
<add-todo on-add="$ctrl.createTodo(todo)"></add-todo>
66

77
<ul class="demo-list">
8-
<li ng-repeat="item in ctrl.todos">
8+
<li ng-repeat="item in $ctrl.todos">
99

1010
<todo-item
1111
todo="item"
12-
on-done="ctrl.markAsDone(todo)"
12+
on-done="$ctrl.markAsDone(todo)"
1313
idx="$index">
1414
<button
15-
ng-click="ctrl.removeTodo(item)"
15+
ng-click="$ctrl.removeTodo(item)"
1616
class="mdl-button mdl-js-button mdl-button--accent">
1717
Remove
1818
</button>

playground/app/components/todo-item.component.ts

+4-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,10 @@ import { TodoModel } from '../stores/todoStore.service';
33

44
@Component({
55
selector: 'todo-item',
6-
templateUrl: './app/components/todo-item.html'
6+
templateUrl: './app/components/todo-item.html',
7+
legacy: {
8+
transclude: true
9+
}
710
})
811
export class TodoItemCmp{
912

+6-6
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
1-
<label for="{{ctrl.idx}}"
1+
<label for="{{$ctrl.idx}}"
22
class="mdl-checkbox mdl-js-checkbox mdl-js-ripple-effect"
3-
ng-class="{'todo__list--complete': ctrl.todo.complete }"
3+
ng-class="{'todo__list--complete': $ctrl.todo.complete }"
44
element-ready>
55

66
<input
77
type="checkbox"
8-
id="{{ctrl.idx}}"
8+
id="{{$ctrl.idx}}"
99
class="mdl-checkbox__input"
10-
ng-model="ctrl.todo.complete"
11-
ng-change="ctrl.done(ctrl.todo)">
12-
<span class="mdl-checkbox__label">{{ ctrl.todo.label }}</span>
10+
ng-model="$ctrl.todo.complete"
11+
ng-change="$ctrl.done($ctrl.todo)">
12+
<span class="mdl-checkbox__label">{{ $ctrl.todo.label }}</span>
1313

1414
</label>
1515
<ng-transclude></ng-transclude>

playground/app/directives/element-ready.directive.ts

-1
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,5 @@ export class ElementReadyDirective implements OnInit {
3131
//this.$scope.$watch( componentHandler.upgradeAllRegistered )
3232

3333
}
34-
}
3534

3635
}

playground/app/pipes/remainingTodos.pipe.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import { TodoModel } from '../stores/todoStore.service';
66
} )
77
export class RemainingTodosPipe {
88

9-
transform( todos: TodoModel[] ): string {
9+
transform( todos: TodoModel[] = [] ): string {
1010

1111

1212
// method to iterate the todo items and return

0 commit comments

Comments
 (0)