File tree 6 files changed +18
-16
lines changed
6 files changed +18
-16
lines changed Original file line number Diff line number Diff line change 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 >
2
2
3
3
< div >
4
4
5
5
< 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 ">
7
7
< label class ="mdl-textfield__label " for ="sample3 "> What needs to be done?</ label >
8
8
</ div >
9
9
<!-- Accent-colored raised button with ripple -->
Original file line number Diff line number Diff line change 1
1
< h1 > Todos yo!</ h1 >
2
2
3
- < h3 > Todo List remaining: {{ ctrl.todos | remainingTodos }}</ h3 >
3
+ < h3 > Todo List remaining: {{ $ ctrl.todos | remainingTodos }}</ h3 >
4
4
5
- < add-todo on-add ="ctrl.createTodo(todo) "> </ add-todo >
5
+ < add-todo on-add ="$ ctrl.createTodo(todo) "> </ add-todo >
6
6
7
7
< ul class ="demo-list ">
8
- < li ng-repeat ="item in ctrl.todos ">
8
+ < li ng-repeat ="item in $ ctrl.todos ">
9
9
10
10
< todo-item
11
11
todo ="item "
12
- on-done ="ctrl.markAsDone(todo) "
12
+ on-done ="$ ctrl.markAsDone(todo) "
13
13
idx ="$index ">
14
14
< button
15
- ng-click ="ctrl.removeTodo(item) "
15
+ ng-click ="$ ctrl.removeTodo(item) "
16
16
class ="mdl-button mdl-js-button mdl-button--accent ">
17
17
Remove
18
18
</ button >
Original file line number Diff line number Diff line change @@ -3,7 +3,10 @@ import { TodoModel } from '../stores/todoStore.service';
3
3
4
4
@Component ( {
5
5
selector : 'todo-item' ,
6
- templateUrl : './app/components/todo-item.html'
6
+ templateUrl : './app/components/todo-item.html' ,
7
+ legacy : {
8
+ transclude : true
9
+ }
7
10
} )
8
11
export class TodoItemCmp {
9
12
Original file line number Diff line number Diff line change 1
- < label for ="{{ctrl.idx}} "
1
+ < label for ="{{$ ctrl.idx}} "
2
2
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 } "
4
4
element-ready >
5
5
6
6
< input
7
7
type ="checkbox "
8
- id ="{{ctrl.idx}} "
8
+ id ="{{$ ctrl.idx}} "
9
9
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 >
13
13
14
14
</ label >
15
15
< ng-transclude > </ ng-transclude >
Original file line number Diff line number Diff line change @@ -31,6 +31,5 @@ export class ElementReadyDirective implements OnInit {
31
31
//this.$scope.$watch( componentHandler.upgradeAllRegistered )
32
32
33
33
}
34
- }
35
34
36
35
}
Original file line number Diff line number Diff line change @@ -6,7 +6,7 @@ import { TodoModel } from '../stores/todoStore.service';
6
6
} )
7
7
export class RemainingTodosPipe {
8
8
9
- transform ( todos : TodoModel [ ] ) : string {
9
+ transform ( todos : TodoModel [ ] = [ ] ) : string {
10
10
11
11
12
12
// method to iterate the todo items and return
You can’t perform that action at this time.
0 commit comments