Adds any metadata attached to a parameter to the "parameters" value passed in to `registerType`. For example: `MyComponent(@Inject(Foo) foo)` generates `"parameters": const [const [const Inject(Foo)]]` Also reorganizes the testing code. Closes #7
23 lines
504 B
Dart
23 lines
504 B
Dart
library angular2.src.transform.common.formatter;
|
|
|
|
import 'package:dart_style/dart_style.dart';
|
|
|
|
import 'logging.dart';
|
|
|
|
DartFormatter _formatter = null;
|
|
|
|
void init(DartFormatter formatter) {
|
|
if (_formatter != null) {
|
|
logger.warning('Formatter is being overwritten.');
|
|
}
|
|
_formatter = formatter;
|
|
}
|
|
|
|
DartFormatter get formatter {
|
|
if (_formatter == null) {
|
|
logger.info('Formatter never initialized, using default formatter.');
|
|
_formatter = new DartFormatter();
|
|
}
|
|
return _formatter;
|
|
}
|