2015-12-05 20:35:03 -05:00
|
|
|
// #docregion
|
|
|
|
import 'package:angular2/angular2.dart';
|
2016-01-27 18:51:50 -05:00
|
|
|
|
|
|
|
import 'hero.dart';
|
|
|
|
import 'logger_service.dart';
|
2015-12-05 20:35:03 -05:00
|
|
|
|
|
|
|
@Injectable()
|
|
|
|
class BackendService {
|
|
|
|
final Logger _logger;
|
|
|
|
List getAll(type) {
|
|
|
|
// TODO get from the database and return as a promise
|
|
|
|
if (type == Hero) {
|
|
|
|
return [
|
|
|
|
new Hero('Windstorm', power: 'Weather mastery'),
|
|
|
|
new Hero('Mr. Nice', power: 'Killing them with kindness'),
|
|
|
|
new Hero('Magneta', power: 'Manipulates metalic objects')
|
|
|
|
];
|
|
|
|
}
|
|
|
|
_logger.error('Cannot get object of this type');
|
|
|
|
throw new ArgumentError("TODO: put log content here");
|
|
|
|
}
|
|
|
|
|
|
|
|
BackendService(Logger this._logger);
|
|
|
|
}
|