diff --git a/modules/angular2/src/change_detection/pregen_proto_change_detector.dart b/modules/angular2/src/change_detection/pregen_proto_change_detector.dart index db0542e0c6..0a2ff79f41 100644 --- a/modules/angular2/src/change_detection/pregen_proto_change_detector.dart +++ b/modules/angular2/src/change_detection/pregen_proto_change_detector.dart @@ -15,8 +15,7 @@ export 'package:angular2/src/change_detection/directive_record.dart' show DirectiveIndex, DirectiveRecord; export 'package:angular2/src/change_detection/interfaces.dart' show ChangeDetector, ChangeDetectorDefinition, ProtoChangeDetector; -export 'package:angular2/src/change_detection/pipes/pipes.dart' - show Pipes; +export 'package:angular2/src/change_detection/pipes/pipes.dart' show Pipes; export 'package:angular2/src/change_detection/proto_record.dart' show ProtoRecord; export 'package:angular2/src/change_detection/change_detection_util.dart' @@ -27,8 +26,7 @@ typedef ProtoChangeDetector PregenProtoChangeDetectorFactory( ChangeDetectorDefinition definition); typedef ChangeDetector InstantiateMethod(dynamic dispatcher, - List protoRecords, - List directiveRecords); + List protoRecords, List directiveRecords); /// Implementation of [ProtoChangeDetector] for use by pre-generated change /// detectors in Angular 2 Dart. @@ -52,19 +50,19 @@ class PregenProtoChangeDetector extends ProtoChangeDetector { static bool isSupported() => true; - factory PregenProtoChangeDetector(InstantiateMethod instantiateMethod, - ChangeDetectorDefinition def) { + factory PregenProtoChangeDetector( + InstantiateMethod instantiateMethod, ChangeDetectorDefinition def) { // TODO(kegluneq): Pre-generate these (#2067). var recordBuilder = new ProtoRecordBuilder(); def.bindingRecords.forEach((b) { recordBuilder.add(b, def.variableNames); }); var protoRecords = coalesce(recordBuilder.records); - return new PregenProtoChangeDetector._(def.id, instantiateMethod, - protoRecords, def.directiveRecords); + return new PregenProtoChangeDetector._( + def.id, instantiateMethod, protoRecords, def.directiveRecords); } @override - instantiate(dynamic dispatcher) => _instantiateMethod( - dispatcher, _protoRecords, _directiveRecords); + instantiate(dynamic dispatcher) => + _instantiateMethod(dispatcher, _protoRecords, _directiveRecords); } diff --git a/modules/angular2/src/core/application.dart b/modules/angular2/src/core/application.dart index d6fa23c6f6..691fb69d45 100644 --- a/modules/angular2/src/core/application.dart +++ b/modules/angular2/src/core/application.dart @@ -3,7 +3,8 @@ library angular2.application; import 'dart:async'; import 'package:angular2/src/reflection/reflection.dart' show reflector; -import 'package:angular2/src/reflection/reflection_capabilities.dart' show ReflectionCapabilities; +import 'package:angular2/src/reflection/reflection_capabilities.dart' + show ReflectionCapabilities; import 'application_common.dart'; export 'application_common.dart' show ApplicationRef; diff --git a/modules/angular2/src/core/application_static.dart b/modules/angular2/src/core/application_static.dart index 6d8cb45e1a..d8e01d5529 100644 --- a/modules/angular2/src/core/application_static.dart +++ b/modules/angular2/src/core/application_static.dart @@ -6,8 +6,7 @@ import 'application_common.dart'; /// Starts an application from a root component. /// /// See [commonBootstrap] for detailed documentation. -Future bootstrapStatic( - Type appComponentType, +Future bootstrapStatic(Type appComponentType, [List componentInjectableBindings]) { return commonBootstrap(appComponentType, componentInjectableBindings); } diff --git a/modules/angular2/src/core/compiler/query_list.dart b/modules/angular2/src/core/compiler/query_list.dart index 8bb4b89d86..82c3f8d337 100644 --- a/modules/angular2/src/core/compiler/query_list.dart +++ b/modules/angular2/src/core/compiler/query_list.dart @@ -10,7 +10,8 @@ import './interface_query.dart'; * In the future this class will implement an Observable interface. * For now it uses a plain list of observable callbacks. */ -class QueryList extends Object with IterableMixin implements IQueryList { +class QueryList extends Object with IterableMixin + implements IQueryList { List _results = []; List _callbacks = []; bool _dirty = false; diff --git a/modules/angular2/src/core/zone/ng_zone.dart b/modules/angular2/src/core/zone/ng_zone.dart index b78a0e9807..2912a09d41 100644 --- a/modules/angular2/src/core/zone/ng_zone.dart +++ b/modules/angular2/src/core/zone/ng_zone.dart @@ -11,7 +11,6 @@ typedef void ErrorHandlingFn(error, stackTrace); * is cancelled. */ class WrappedTimer implements Timer { - Timer _timer; ZeroArgFunction _onCancelCb; @@ -124,7 +123,8 @@ class NgZone { * * This hook is useful for validating application state (e.g. in a test). */ - void overrideOnEventDone(ZeroArgFunction onEventDoneFn, [bool waitForAsync = false]) { + void overrideOnEventDone(ZeroArgFunction onEventDoneFn, + [bool waitForAsync = false]) { _onEventDone = onEventDoneFn; if (waitForAsync) { @@ -264,7 +264,8 @@ class NgZone { } } - Timer _createTimer(Zone self, ZoneDelegate parent, Zone zone, Duration duration, fn()) { + Timer _createTimer( + Zone self, ZoneDelegate parent, Zone zone, Duration duration, fn()) { WrappedTimer wrappedTimer; var cb = () { fn(); diff --git a/modules/angular2/src/di/decorators.dart b/modules/angular2/src/di/decorators.dart index 9736d9db66..fa0cd74c88 100644 --- a/modules/angular2/src/di/decorators.dart +++ b/modules/angular2/src/di/decorators.dart @@ -7,40 +7,40 @@ export 'metadata.dart'; * {@link InjectMetadata}. */ class Inject extends InjectMetadata { - const Inject(dynamic token): super(token); + const Inject(dynamic token) : super(token); } /** * {@link OptionalMetadata}. */ class Optional extends OptionalMetadata { - const Optional(): super(); + const Optional() : super(); } /** * {@link InjectableMetadata}. */ class Injectable extends InjectableMetadata { - const Injectable(): super(); + const Injectable() : super(); } /** * {@link SelfMetadata}. */ class Self extends SelfMetadata { - const Self(): super(); + const Self() : super(); } /** * {@link AncestorMetadata}. */ class Ancestor extends AncestorMetadata { - const Ancestor({bool self}): super(self:self); + const Ancestor({bool self}) : super(self: self); } /** * {@link UnboundedMetadata}. */ class Unbounded extends UnboundedMetadata { - const Unbounded({bool self}): super(self:self); -} \ No newline at end of file + const Unbounded({bool self}) : super(self: self); +} diff --git a/modules/angular2/src/directives/observable_list_diff.dart b/modules/angular2/src/directives/observable_list_diff.dart index 25caf41a4b..b0a076758d 100644 --- a/modules/angular2/src/directives/observable_list_diff.dart +++ b/modules/angular2/src/directives/observable_list_diff.dart @@ -41,16 +41,16 @@ class ObservableListDiff extends IterableChanges { _updated = false; return super.transform(collection, args); - // An update has been registered since the last change detection check. - // - We reset the flag. - // - We diff the collection. - } else if (_updated){ + // An update has been registered since the last change detection check. + // - We reset the flag. + // - We diff the collection. + } else if (_updated) { _updated = false; - return super.transform(collection, args); + return super.transform(collection, args); - // No updates has been registered. - // Returning this tells change detection that object has not change, - // so it should NOT update the binding. + // No updates has been registered. + // Returning this tells change detection that object has not change, + // so it should NOT update the binding. } else { return this; } diff --git a/modules/angular2/src/dom/browser_adapter.dart b/modules/angular2/src/dom/browser_adapter.dart index b3855f37db..37b9e5c6b3 100644 --- a/modules/angular2/src/dom/browser_adapter.dart +++ b/modules/angular2/src/dom/browser_adapter.dart @@ -392,7 +392,6 @@ class BrowserDomAdapter extends GenericBrowserDomAdapter { } } - var baseElement = null; String getBaseElementHref() { if (baseElement == null) { diff --git a/modules/angular2/src/dom/html_adapter.dart b/modules/angular2/src/dom/html_adapter.dart index d1dc7159f2..0082b082a9 100644 --- a/modules/angular2/src/dom/html_adapter.dart +++ b/modules/angular2/src/dom/html_adapter.dart @@ -17,20 +17,25 @@ class Html5LibDomAdapter implements DomAdapter { return true; } - void setProperty(Element element, String name, Object value) => throw 'not implemented'; + void setProperty(Element element, String name, Object value) => + throw 'not implemented'; getProperty(Element element, String name) => throw 'not implemented'; - invoke(Element element, String methodName, List args) => throw 'not implemented'; + invoke(Element element, String methodName, List args) => + throw 'not implemented'; logError(error) { stderr.writeln('${error}'); } - log(error) { stdout.writeln('${error}'); } - logGroup(error) { stdout.writeln('${error}'); } - logGroupEnd() { } - + log(error) { + stdout.writeln('${error}'); + } + logGroup(error) { + stdout.writeln('${error}'); + } + logGroupEnd() {} @override final attrToPropMap = const { @@ -245,8 +250,8 @@ class Html5LibDomAdapter implements DomAdapter { } getAttribute(element, String attribute) { // `attributes` keys can be {@link AttributeName}s. - var key = element.attributes.keys.firstWhere( - (key) => '$key' == attribute, orElse: () {}); + var key = element.attributes.keys.firstWhere((key) => '$key' == attribute, + orElse: () {}); return element.attributes[key]; } setAttribute(element, String name, String value) { diff --git a/modules/angular2/src/facade/async.dart b/modules/angular2/src/facade/async.dart index 1a00b0b6e5..a54328a211 100644 --- a/modules/angular2/src/facade/async.dart +++ b/modules/angular2/src/facade/async.dart @@ -29,7 +29,8 @@ class PromiseWrapper { return promise.catchError(onError); } - static PromiseCompleter completer() => new PromiseCompleter(new Completer()); + static PromiseCompleter completer() => + new PromiseCompleter(new Completer()); } class TimerWrapper { diff --git a/modules/angular2/src/facade/intl.dart b/modules/angular2/src/facade/intl.dart index 56b1fa657d..b3c6ef81db 100644 --- a/modules/angular2/src/facade/intl.dart +++ b/modules/angular2/src/facade/intl.dart @@ -4,18 +4,12 @@ import 'package:intl/intl.dart'; String _normalizeLocale(String locale) => locale.replaceAll('-', '_'); -enum NumberFormatStyle { - DECIMAL, - PERCENT, - CURRENCY -} +enum NumberFormatStyle { DECIMAL, PERCENT, CURRENCY } class NumberFormatter { static String format(num number, String locale, NumberFormatStyle style, - {int minimumIntegerDigits: 1, - int minimumFractionDigits: 0, - int maximumFractionDigits: 3, - String currency, + {int minimumIntegerDigits: 1, int minimumFractionDigits: 0, + int maximumFractionDigits: 3, String currency, bool currencyAsSymbol: false}) { locale = _normalizeLocale(locale); NumberFormat formatter; @@ -29,7 +23,8 @@ class NumberFormatter { case NumberFormatStyle.CURRENCY: if (currencyAsSymbol) { // See https://github.com/dart-lang/intl/issues/59. - throw new Exception('Displaying currency as symbol is not supported.'); + throw new Exception( + 'Displaying currency as symbol is not supported.'); } formatter = new NumberFormat.currencyPattern(locale, currency); break; diff --git a/modules/angular2/src/facade/lang.dart b/modules/angular2/src/facade/lang.dart index b7941540b2..57bd90b6e7 100644 --- a/modules/angular2/src/facade/lang.dart +++ b/modules/angular2/src/facade/lang.dart @@ -201,7 +201,8 @@ class BaseException extends Error { final originalException; final originalStack; - BaseException([this.message, this.originalException, this.originalStack, this.context]); + BaseException( + [this.message, this.originalException, this.originalStack, this.context]); String toString() { return this.message; diff --git a/modules/angular2/src/http/backends/browser_jsonp.dart b/modules/angular2/src/http/backends/browser_jsonp.dart index 9bf4ef2ef0..08ef1162d2 100644 --- a/modules/angular2/src/http/backends/browser_jsonp.dart +++ b/modules/angular2/src/http/backends/browser_jsonp.dart @@ -1,4 +1,5 @@ library angular2.src.http.backends.browser_jsonp; + import 'package:angular2/di.dart'; import 'dart:html' show document; import 'dart:js' show context, JsObject, JsArray; @@ -50,7 +51,9 @@ class BrowserJsonp { } // Attach the