Also update dart_to_js_script_rewriter dependency to ^1.0.1, and change most angular2.dart imports to be core.dart instead. The pipes example broke without the angular2.dart import, so I let it be. The server-communication sample has never worked for me, so I changed it but might have broken it further. closes #1007
20 lines
505 B
Dart
20 lines
505 B
Dart
import 'package:angular2/core.dart';
|
|
|
|
import 'backend_service.dart';
|
|
import 'hero.dart';
|
|
import 'logger_service.dart';
|
|
|
|
// #docregion class
|
|
@Injectable()
|
|
class HeroService {
|
|
final BackendService _backendService;
|
|
final Logger _logger;
|
|
HeroService(Logger this._logger, BackendService this._backendService);
|
|
List<Hero> getHeroes() {
|
|
List<Hero> heroes = _backendService.getAll(Hero);
|
|
_logger.log('Got ${heroes.length} heroes from the server.');
|
|
return heroes;
|
|
}
|
|
}
|
|
// #enddocregion class
|