Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
42 lines (33 sloc) 881 Bytes
import 'dart:async';
import 'package:angular/angular.dart';
import 'package:angular_components/angular_components.dart';
import 'todo_list_service.dart';
@Component(
selector: 'todo-list',
styleUrls: ['todo_list_component.css'],
templateUrl: 'todo_list_component.html',
directives: [
MaterialCheckboxComponent,
MaterialFabComponent,
MaterialIconComponent,
materialInputDirectives,
NgFor,
NgIf,
],
providers: [ClassProvider(TodoListService)],
)
class TodoListComponent implements OnInit {
final TodoListService todoListService;
List<String> items = [];
String newTodo = '';
TodoListComponent(this.todoListService);
@override
Future<Null> ngOnInit() async {
items = await todoListService.getTodoList();
}
void add() {
items.add(newTodo);
newTodo = '';
}
String remove(int index) => items.removeAt(index);
}
You can’t perform that action at this time.