Adão Júnior c4ae1f1b1b docs(guide/lifecycle-hooks): add Dart version of example
NOTE: The Dart version generates fewer lifecycle events than the TS version.
See angular/angular#6498 for details.

closes #733
2016-01-21 16:34:17 -08:00

19 lines
293 B
Dart

import 'package:angular2/angular2.dart';
import 'dart:async';
@Injectable()
class LoggerService {
List<String> logs = [];
log(String msg, [bool noTick = false]) {
if (!noTick) {
tick();
}
logs.add(msg);
}
clear() => logs.clear();
tick() => new Future(() {});
}