Skip to content

Commit 03627aa

Browse files
committed
chore(format): update to latest formatter
Closes angular#7958
1 parent 83b8f59 commit 03627aa

File tree

527 files changed

+14082
-19359
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

527 files changed

+14082
-19359
lines changed

gulpfile.js

Lines changed: 379 additions & 345 deletions
Large diffs are not rendered by default.

modules/angular1_router/src/ng_outlet.ts

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ function ngOutletDirective($animate, $q: ng.IQService, $rootRouter) {
7878
result = this.currentController.$routerCanReuse(nextInstruction, this.currentInstruction);
7979
} else {
8080
result = nextInstruction === this.currentInstruction ||
81-
angular.equals(nextInstruction.params, this.currentInstruction.params);
81+
angular.equals(nextInstruction.params, this.currentInstruction.params);
8282
}
8383
return $q.when(result);
8484
}
@@ -110,7 +110,7 @@ function ngOutletDirective($animate, $q: ng.IQService, $rootRouter) {
110110
}
111111

112112
this.controller.$$template = '<' + dashCase(componentName) + ' $router="::$$router"></' +
113-
dashCase(componentName) + '>';
113+
dashCase(componentName) + '>';
114114
this.controller.$$router = this.router.childRouter(instruction.componentType);
115115
this.controller.$$outlet = this;
116116

@@ -165,8 +165,8 @@ function routerTriggerDirective($q) {
165165
var currentComponent = outlet.currentController =
166166
element.controller(ngOutletCtrl.$$componentName);
167167
if (currentComponent.$routerOnActivate) {
168-
promise = $q.when(currentComponent.$routerOnActivate(outlet.currentInstruction,
169-
outlet.previousInstruction));
168+
promise = $q.when(currentComponent.$routerOnActivate(
169+
outlet.currentInstruction, outlet.previousInstruction));
170170
}
171171
promise.then(outlet.deferredActivation.resolve, outlet.deferredActivation.reject);
172172
}
@@ -213,14 +213,15 @@ function ngLinkDirective($rootRouter, $parse) {
213213
function getLink(params) {
214214
navigationInstruction = router.generate(params);
215215

216-
scope.$watch(function() { return router.isRouteActive(navigationInstruction); },
217-
function(active) {
218-
if (active) {
219-
element.addClass('ng-link-active');
220-
} else {
221-
element.removeClass('ng-link-active');
222-
}
223-
});
216+
scope.$watch(
217+
function() { return router.isRouteActive(navigationInstruction); },
218+
function(active) {
219+
if (active) {
220+
element.addClass('ng-link-active');
221+
} else {
222+
element.removeClass('ng-link-active');
223+
}
224+
});
224225

225226
const navigationHref = navigationInstruction.toLinkUrl();
226227
return $rootRouter._location.prepareExternalUrl(navigationHref);
@@ -232,8 +233,8 @@ function ngLinkDirective($rootRouter, $parse) {
232233
let params = routeParamsGetter();
233234
element.attr('href', getLink(params));
234235
} else {
235-
scope.$watch(() => routeParamsGetter(scope), params => element.attr('href', getLink(params)),
236-
true);
236+
scope.$watch(
237+
() => routeParamsGetter(scope), params => element.attr('href', getLink(params)), true);
237238
}
238239

239240
element.on('click', event => {

modules/angular2/core.ts

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,7 @@ export * from './src/core/di';
1010
export * from './src/facade/facade';
1111
export {enableProdMode} from 'angular2/src/facade/lang';
1212
export {platform, createNgZone, PlatformRef, ApplicationRef} from './src/core/application_ref';
13-
export {
14-
APP_ID,
15-
APP_COMPONENT,
16-
APP_INITIALIZER,
17-
PACKAGE_ROOT_URL,
18-
PLATFORM_INITIALIZER
19-
} from './src/core/application_tokens';
13+
export {APP_ID, APP_COMPONENT, APP_INITIALIZER, PACKAGE_ROOT_URL, PLATFORM_INITIALIZER} from './src/core/application_tokens';
2014
export * from './src/core/zone';
2115
export * from './src/core/render';
2216
export * from './src/core/linker';

modules/angular2/examples/core/di/ts/forward_ref/forward_ref.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ expect(door.lock instanceof Lock).toBe(true);
2020
// #enddocregion
2121

2222
// #docregion resolve_forward_ref
23-
var ref = forwardRef(() => "refValue");
24-
expect(resolveForwardRef(ref)).toEqual("refValue");
25-
expect(resolveForwardRef("regularValue")).toEqual("regularValue");
23+
var ref = forwardRef(() => 'refValue');
24+
expect(resolveForwardRef(ref)).toEqual('refValue');
25+
expect(resolveForwardRef('regularValue')).toEqual('regularValue');
2626
// #enddocregion

modules/angular2/examples/core/pipes/ts/async_pipe/async_pipe_example.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,15 +27,15 @@ export class AsyncPipeExample {
2727
if (this.arrived) {
2828
this.reset();
2929
} else {
30-
this.resolve("hi there!");
30+
this.resolve('hi there!');
3131
this.arrived = true;
3232
}
3333
}
3434
}
3535
// #enddocregion
3636

3737
// #docregion AsyncPipeObservable
38-
@Component({selector: "task-cmp", template: "Time: {{ time | async }}"})
38+
@Component({selector: 'task-cmp', template: 'Time: {{ time | async }}'})
3939
class Task {
4040
time = new Observable<number>((observer: Subscriber<number>) => {
4141
setInterval(() => observer.next(new Date().getTime()), 500);

modules/angular2/examples/router/ts/can_activate/can_activate_example.ts

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,6 @@
11
import {provide, Component} from 'angular2/core';
22
import {bootstrap} from 'angular2/platform/browser';
3-
import {
4-
CanActivate,
5-
RouteConfig,
6-
ComponentInstruction,
7-
APP_BASE_HREF,
8-
ROUTER_DIRECTIVES
9-
} from 'angular2/router';
3+
import {CanActivate, RouteConfig, ComponentInstruction, APP_BASE_HREF, ROUTER_DIRECTIVES} from 'angular2/router';
104

115
function checkIfWeHavePermission(instruction: ComponentInstruction) {
126
return instruction.params['id'] == '1';

modules/angular2/examples/router/ts/can_deactivate/can_deactivate_example.ts

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,6 @@
11
import {provide, Component} from 'angular2/core';
22
import {bootstrap} from 'angular2/platform/browser';
3-
import {
4-
CanDeactivate,
5-
RouteConfig,
6-
RouteParams,
7-
ComponentInstruction,
8-
ROUTER_DIRECTIVES,
9-
APP_BASE_HREF
10-
} from 'angular2/router';
3+
import {CanDeactivate, RouteConfig, RouteParams, ComponentInstruction, ROUTER_DIRECTIVES, APP_BASE_HREF} from 'angular2/router';
114

125
// #docregion routerCanDeactivate
136
@Component({

modules/angular2/examples/router/ts/on_activate/on_activate_example.ts

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,6 @@
11
import {Component, provide} from 'angular2/core';
22
import {bootstrap} from 'angular2/platform/browser';
3-
import {
4-
OnActivate,
5-
ComponentInstruction,
6-
RouteConfig,
7-
ROUTER_DIRECTIVES,
8-
APP_BASE_HREF
9-
} from 'angular2/router';
3+
import {OnActivate, ComponentInstruction, RouteConfig, ROUTER_DIRECTIVES, APP_BASE_HREF} from 'angular2/router';
104

115
// #docregion routerOnActivate
126
@Component({template: `Child`})

modules/angular2/examples/router/ts/on_deactivate/on_deactivate_example.ts

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,6 @@
11
import {Component, Injectable, provide} from 'angular2/core';
22
import {bootstrap} from 'angular2/platform/browser';
3-
import {
4-
OnDeactivate,
5-
ComponentInstruction,
6-
RouteConfig,
7-
ROUTER_DIRECTIVES,
8-
APP_BASE_HREF
9-
} from 'angular2/router';
3+
import {OnDeactivate, ComponentInstruction, RouteConfig, ROUTER_DIRECTIVES, APP_BASE_HREF} from 'angular2/router';
104

115

126
@Injectable()
@@ -57,7 +51,6 @@ class AppCmp {
5751

5852
export function main() {
5953
return bootstrap(AppCmp, [
60-
provide(APP_BASE_HREF, {useValue: '/angular2/examples/router/ts/on_deactivate'}),
61-
LogService
54+
provide(APP_BASE_HREF, {useValue: '/angular2/examples/router/ts/on_deactivate'}), LogService
6255
]);
6356
}

modules/angular2/examples/router/ts/reuse/reuse_example.ts

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,6 @@
11
import {Component, provide} from 'angular2/core';
22
import {bootstrap} from 'angular2/platform/browser';
3-
import {
4-
CanActivate,
5-
RouteConfig,
6-
ComponentInstruction,
7-
ROUTER_DIRECTIVES,
8-
APP_BASE_HREF,
9-
CanReuse,
10-
RouteParams,
11-
OnReuse
12-
} from 'angular2/router';
3+
import {CanActivate, RouteConfig, ComponentInstruction, ROUTER_DIRECTIVES, APP_BASE_HREF, CanReuse, RouteParams, OnReuse} from 'angular2/router';
134

145

156
// #docregion reuseCmp
@@ -53,6 +44,6 @@ class AppCmp {
5344

5445

5546
export function main() {
56-
return bootstrap(AppCmp,
57-
[provide(APP_BASE_HREF, {useValue: '/angular2/examples/router/ts/reuse'})]);
47+
return bootstrap(
48+
AppCmp, [provide(APP_BASE_HREF, {useValue: '/angular2/examples/router/ts/reuse'})]);
5849
}

modules/angular2/examples/testing/ts/testing.ts

Lines changed: 8 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,4 @@
1-
import {
2-
describe,
3-
fdescribe,
4-
xdescribe,
5-
it,
6-
fit,
7-
xit,
8-
beforeEach,
9-
afterEach,
10-
beforeEachProviders,
11-
inject
12-
} from 'angular2/testing';
1+
import {describe, fdescribe, xdescribe, it, fit, xit, beforeEach, afterEach, beforeEachProviders, inject} from 'angular2/testing';
132
import {provide} from 'angular2/core';
143

154
var db: any;
@@ -30,8 +19,9 @@ fdescribe('some component', () => {
3019
// This test will run.
3120
});
3221
});
33-
describe('another component',
34-
() => { it('also has a test', () => { throw 'This test will not run.'; }); });
22+
describe('another component', () => {
23+
it('also has a test', () => { throw 'This test will not run.'; });
24+
});
3525
// #enddocregion
3626

3727
// #docregion xdescribe
@@ -73,9 +63,10 @@ describe('some component', () => {
7363
// #docregion beforeEachProviders
7464
describe('some component', () => {
7565
beforeEachProviders(() => [provide(MyService, {useClass: MyMockService})]);
76-
it('uses MyService', inject([MyService], (service: MyMockService) => {
77-
// service is an instance of MyMockService.
78-
}));
66+
it('uses MyService', inject(
67+
[MyService], (service: MyMockService) => {
68+
// service is an instance of MyMockService.
69+
}));
7970
});
8071
// #enddocregion
8172

modules/angular2/http.ts

Lines changed: 14 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,7 @@ import {BaseResponseOptions, ResponseOptions} from './src/http/base_response_opt
1616
export {Request} from './src/http/static_request';
1717
export {Response} from './src/http/static_response';
1818

19-
export {
20-
RequestOptionsArgs,
21-
ResponseOptionsArgs,
22-
Connection,
23-
ConnectionBackend
24-
} from './src/http/interfaces';
19+
export {RequestOptionsArgs, ResponseOptionsArgs, Connection, ConnectionBackend} from './src/http/interfaces';
2520

2621
export {BrowserXhr} from './src/http/backends/browser_xhr';
2722
export {BaseRequestOptions, RequestOptions} from './src/http/base_request_options';
@@ -155,16 +150,13 @@ export {URLSearchParams} from './src/http/url_search_params';
155150
export const HTTP_PROVIDERS: any[] = [
156151
// TODO(pascal): use factory type annotations once supported in DI
157152
// issue: https://github.com/angular/angular/issues/3183
158-
provide(Http,
159-
{
160-
useFactory: (xhrBackend: XHRBackend, requestOptions: RequestOptions) =>
161-
new Http(xhrBackend, requestOptions),
162-
deps: [XHRBackend, RequestOptions]
163-
}),
164-
BrowserXhr,
165-
provide(RequestOptions, {useClass: BaseRequestOptions}),
166-
provide(ResponseOptions, {useClass: BaseResponseOptions}),
167-
XHRBackend
153+
provide(Http, {
154+
useFactory: (xhrBackend: XHRBackend, requestOptions: RequestOptions) =>
155+
new Http(xhrBackend, requestOptions),
156+
deps: [XHRBackend, RequestOptions]
157+
}),
158+
BrowserXhr, provide(RequestOptions, {useClass: BaseRequestOptions}),
159+
provide(ResponseOptions, {useClass: BaseResponseOptions}), XHRBackend
168160
];
169161

170162
/**
@@ -284,14 +276,12 @@ export const HTTP_BINDINGS = HTTP_PROVIDERS;
284276
export const JSONP_PROVIDERS: any[] = [
285277
// TODO(pascal): use factory type annotations once supported in DI
286278
// issue: https://github.com/angular/angular/issues/3183
287-
provide(Jsonp,
288-
{
289-
useFactory: (jsonpBackend: JSONPBackend, requestOptions: RequestOptions) =>
290-
new Jsonp(jsonpBackend, requestOptions),
291-
deps: [JSONPBackend, RequestOptions]
292-
}),
293-
BrowserJsonp,
294-
provide(RequestOptions, {useClass: BaseRequestOptions}),
279+
provide(Jsonp, {
280+
useFactory: (jsonpBackend: JSONPBackend, requestOptions: RequestOptions) =>
281+
new Jsonp(jsonpBackend, requestOptions),
282+
deps: [JSONPBackend, RequestOptions]
283+
}),
284+
BrowserJsonp, provide(RequestOptions, {useClass: BaseRequestOptions}),
295285
provide(ResponseOptions, {useClass: BaseResponseOptions}),
296286
provide(JSONPBackend, {useClass: JSONPBackend_})
297287
];

modules/angular2/instrumentation.ts

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1 @@
1-
export {
2-
wtfCreateScope,
3-
wtfLeave,
4-
wtfStartTimeRange,
5-
wtfEndTimeRange,
6-
WtfScopeFn
7-
} from './src/core/profile/profile';
1+
export {wtfCreateScope, wtfLeave, wtfStartTimeRange, wtfEndTimeRange, WtfScopeFn} from './src/core/profile/profile';

modules/angular2/platform/browser.ts

Lines changed: 3 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,12 @@
11
export {AngularEntrypoint} from 'angular2/src/core/angular_entrypoint';
2-
export {
3-
BROWSER_PROVIDERS,
4-
CACHED_TEMPLATE_PROVIDER,
5-
ELEMENT_PROBE_PROVIDERS,
6-
ELEMENT_PROBE_PROVIDERS_PROD_MODE,
7-
inspectNativeElement,
8-
BrowserDomAdapter,
9-
By,
10-
Title,
11-
DOCUMENT,
12-
enableDebugTools,
13-
disableDebugTools
14-
} from 'angular2/src/platform/browser_common';
2+
export {BROWSER_PROVIDERS, CACHED_TEMPLATE_PROVIDER, ELEMENT_PROBE_PROVIDERS, ELEMENT_PROBE_PROVIDERS_PROD_MODE, inspectNativeElement, BrowserDomAdapter, By, Title, DOCUMENT, enableDebugTools, disableDebugTools} from 'angular2/src/platform/browser_common';
153

164
import {Type, isPresent, CONST_EXPR} from 'angular2/src/facade/lang';
17-
import {
18-
BROWSER_PROVIDERS,
19-
BROWSER_APP_COMMON_PROVIDERS
20-
} from 'angular2/src/platform/browser_common';
5+
import {BROWSER_PROVIDERS, BROWSER_APP_COMMON_PROVIDERS} from 'angular2/src/platform/browser_common';
216
import {COMPILER_PROVIDERS} from 'angular2/compiler';
227
import {ComponentRef, platform, reflector} from 'angular2/core';
238
import {ReflectionCapabilities} from 'angular2/src/core/reflection/reflection_capabilities';
24-
import {XHRImpl} from "angular2/src/platform/browser/xhr_impl";
9+
import {XHRImpl} from 'angular2/src/platform/browser/xhr_impl';
2510
import {XHR} from 'angular2/compiler';
2611
import {Provider} from 'angular2/src/core/di';
2712

modules/angular2/platform/browser_static.ts

Lines changed: 5 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,8 @@
11
export {AngularEntrypoint} from 'angular2/src/core/angular_entrypoint';
2-
export {
3-
BROWSER_PROVIDERS,
4-
ELEMENT_PROBE_PROVIDERS,
5-
ELEMENT_PROBE_PROVIDERS_PROD_MODE,
6-
inspectNativeElement,
7-
BrowserDomAdapter,
8-
By,
9-
Title,
10-
enableDebugTools,
11-
disableDebugTools
12-
} from 'angular2/src/platform/browser_common';
2+
export {BROWSER_PROVIDERS, ELEMENT_PROBE_PROVIDERS, ELEMENT_PROBE_PROVIDERS_PROD_MODE, inspectNativeElement, BrowserDomAdapter, By, Title, enableDebugTools, disableDebugTools} from 'angular2/src/platform/browser_common';
133

144
import {Type, isPresent} from 'angular2/src/facade/lang';
15-
import {
16-
BROWSER_PROVIDERS,
17-
BROWSER_APP_COMMON_PROVIDERS
18-
} from 'angular2/src/platform/browser_common';
5+
import {BROWSER_PROVIDERS, BROWSER_APP_COMMON_PROVIDERS} from 'angular2/src/platform/browser_common';
196
import {ComponentRef, platform} from 'angular2/core';
207

218
/**
@@ -29,9 +16,9 @@ export const BROWSER_APP_PROVIDERS: Array<any /*Type | Provider | any[]*/> =
2916
/**
3017
* See {@link bootstrap} for more information.
3118
*/
32-
export function bootstrapStatic(appComponentType: Type,
33-
customProviders?: Array<any /*Type | Provider | any[]*/>,
34-
initReflector?: Function): Promise<ComponentRef> {
19+
export function bootstrapStatic(
20+
appComponentType: Type, customProviders?: Array<any /*Type | Provider | any[]*/>,
21+
initReflector?: Function): Promise<ComponentRef> {
3522
if (isPresent(initReflector)) {
3623
initReflector();
3724
}

modules/angular2/platform/common_dom.ts

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,6 @@ export {DomRenderer} from 'angular2/src/platform/dom/dom_renderer';
66
export {DOCUMENT} from 'angular2/src/platform/dom/dom_tokens';
77
export {SharedStylesHost, DomSharedStylesHost} from 'angular2/src/platform/dom/shared_styles_host';
88
export {DomEventsPlugin} from 'angular2/src/platform/dom/events/dom_events';
9-
export {
10-
EVENT_MANAGER_PLUGINS,
11-
EventManager,
12-
EventManagerPlugin
13-
} from 'angular2/src/platform/dom/events/event_manager';
9+
export {EVENT_MANAGER_PLUGINS, EventManager, EventManagerPlugin} from 'angular2/src/platform/dom/events/event_manager';
1410
export * from 'angular2/src/platform/dom/debug/by';
1511
export * from 'angular2/src/platform/dom/debug/ng_probe';

0 commit comments

Comments
 (0)