Skip to content

Commit

Permalink
feat(playground): update todo app to match latest release
Browse files Browse the repository at this point in the history
  • Loading branch information
Hotell committed Jan 18, 2016
1 parent bed094f commit 51cbd07
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 16 deletions.
4 changes: 2 additions & 2 deletions playground/app/components/add-todo.html
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<form name="ctrl.addTodoForm" novalidate ng-submit="ctrl.addTodo($event, ctrl.label);" element-ready>
<form name="$ctrl.addTodoForm" novalidate ng-submit="$ctrl.addTodo($event, $ctrl.label);" element-ready>

<div>

<div class="mdl-textfield mdl-js-textfield mdl-textfield--floating-label">
<input class="mdl-textfield__input" type="text" id="sample3" ng-model="ctrl.label">
<input class="mdl-textfield__input" type="text" id="sample3" ng-model="$ctrl.label">
<label class="mdl-textfield__label" for="sample3">What needs to be done?</label>
</div>
<!-- Accent-colored raised button with ripple -->
Expand Down
10 changes: 5 additions & 5 deletions playground/app/components/todo-app.html
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
<h1>Todos yo!</h1>

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

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

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

<todo-item
todo="item"
on-done="ctrl.markAsDone(todo)"
on-done="$ctrl.markAsDone(todo)"
idx="$index">
<button
ng-click="ctrl.removeTodo(item)"
ng-click="$ctrl.removeTodo(item)"
class="mdl-button mdl-js-button mdl-button--accent">
Remove
</button>
Expand Down
5 changes: 4 additions & 1 deletion playground/app/components/todo-item.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,10 @@ import { TodoModel } from '../stores/todoStore.service';

@Component({
selector: 'todo-item',
templateUrl: './app/components/todo-item.html'
templateUrl: './app/components/todo-item.html',
legacy: {
transclude: true
}
})
export class TodoItemCmp{

Expand Down
12 changes: 6 additions & 6 deletions playground/app/components/todo-item.html
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
<label for="{{ctrl.idx}}"
<label for="{{$ctrl.idx}}"
class="mdl-checkbox mdl-js-checkbox mdl-js-ripple-effect"
ng-class="{'todo__list--complete': ctrl.todo.complete }"
ng-class="{'todo__list--complete': $ctrl.todo.complete }"
element-ready>

<input
type="checkbox"
id="{{ctrl.idx}}"
id="{{$ctrl.idx}}"
class="mdl-checkbox__input"
ng-model="ctrl.todo.complete"
ng-change="ctrl.done(ctrl.todo)">
<span class="mdl-checkbox__label">{{ ctrl.todo.label }}</span>
ng-model="$ctrl.todo.complete"
ng-change="$ctrl.done($ctrl.todo)">
<span class="mdl-checkbox__label">{{ $ctrl.todo.label }}</span>

</label>
<ng-transclude></ng-transclude>
1 change: 0 additions & 1 deletion playground/app/directives/element-ready.directive.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,5 @@ export class ElementReadyDirective implements OnInit {
//this.$scope.$watch( componentHandler.upgradeAllRegistered )

}
}

}
2 changes: 1 addition & 1 deletion playground/app/pipes/remainingTodos.pipe.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { TodoModel } from '../stores/todoStore.service';
} )
export class RemainingTodosPipe {

transform( todos: TodoModel[] ): string {
transform( todos: TodoModel[] = [] ): string {


// method to iterate the todo items and return
Expand Down

0 comments on commit 51cbd07

Please sign in to comment.