Patrice Chalin 05864c2584 docs(dependency-injection): revised Dart and TS code and prose (#1573)
docs(dependency-injection): revise Dart and TS code and prose
2016-06-03 11:16:46 -07:00

24 lines
423 B
Dart

// Car without DI
import 'car.dart';
//#docregion car
class Car {
//#docregion car-ctor
Engine engine;
Tires tires;
var description = 'No DI';
Car() {
engine = new Engine();
tires = new Tires();
}
//#enddocregion car-ctor
// Method using the engine and tires
String drive() => '$description car with '
'${engine.cylinders} cylinders and '
'${tires.make} tires.';
}
//#enddocregion car