Skip to content

Commit

Permalink
revert(format): Revert "chore(format): update to latest formatter"
Browse files Browse the repository at this point in the history
This reverts commit 03627aa.
  • Loading branch information
alxhub committed Apr 12, 2016
1 parent 03627aa commit 60727c4
Show file tree
Hide file tree
Showing 527 changed files with 19,359 additions and 14,082 deletions.
724 changes: 345 additions & 379 deletions gulpfile.js

Large diffs are not rendered by default.

29 changes: 14 additions & 15 deletions modules/angular1_router/src/ng_outlet.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ function ngOutletDirective($animate, $q: ng.IQService, $rootRouter) {
result = this.currentController.$routerCanReuse(nextInstruction, this.currentInstruction);
} else {
result = nextInstruction === this.currentInstruction ||
angular.equals(nextInstruction.params, this.currentInstruction.params);
angular.equals(nextInstruction.params, this.currentInstruction.params);
}
return $q.when(result);
}
Expand Down Expand Up @@ -110,7 +110,7 @@ function ngOutletDirective($animate, $q: ng.IQService, $rootRouter) {
}

this.controller.$$template = '<' + dashCase(componentName) + ' $router="::$$router"></' +
dashCase(componentName) + '>';
dashCase(componentName) + '>';
this.controller.$$router = this.router.childRouter(instruction.componentType);
this.controller.$$outlet = this;

Expand Down Expand Up @@ -165,8 +165,8 @@ function routerTriggerDirective($q) {
var currentComponent = outlet.currentController =
element.controller(ngOutletCtrl.$$componentName);
if (currentComponent.$routerOnActivate) {
promise = $q.when(currentComponent.$routerOnActivate(
outlet.currentInstruction, outlet.previousInstruction));
promise = $q.when(currentComponent.$routerOnActivate(outlet.currentInstruction,
outlet.previousInstruction));
}
promise.then(outlet.deferredActivation.resolve, outlet.deferredActivation.reject);
}
Expand Down Expand Up @@ -213,15 +213,14 @@ function ngLinkDirective($rootRouter, $parse) {
function getLink(params) {
navigationInstruction = router.generate(params);

scope.$watch(
function() { return router.isRouteActive(navigationInstruction); },
function(active) {
if (active) {
element.addClass('ng-link-active');
} else {
element.removeClass('ng-link-active');
}
});
scope.$watch(function() { return router.isRouteActive(navigationInstruction); },
function(active) {
if (active) {
element.addClass('ng-link-active');
} else {
element.removeClass('ng-link-active');
}
});

const navigationHref = navigationInstruction.toLinkUrl();
return $rootRouter._location.prepareExternalUrl(navigationHref);
Expand All @@ -233,8 +232,8 @@ function ngLinkDirective($rootRouter, $parse) {
let params = routeParamsGetter();
element.attr('href', getLink(params));
} else {
scope.$watch(
() => routeParamsGetter(scope), params => element.attr('href', getLink(params)), true);
scope.$watch(() => routeParamsGetter(scope), params => element.attr('href', getLink(params)),
true);
}

element.on('click', event => {
Expand Down
8 changes: 7 additions & 1 deletion modules/angular2/core.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,13 @@ export * from './src/core/di';
export * from './src/facade/facade';
export {enableProdMode} from 'angular2/src/facade/lang';
export {platform, createNgZone, PlatformRef, ApplicationRef} from './src/core/application_ref';
export {APP_ID, APP_COMPONENT, APP_INITIALIZER, PACKAGE_ROOT_URL, PLATFORM_INITIALIZER} from './src/core/application_tokens';
export {
APP_ID,
APP_COMPONENT,
APP_INITIALIZER,
PACKAGE_ROOT_URL,
PLATFORM_INITIALIZER
} from './src/core/application_tokens';
export * from './src/core/zone';
export * from './src/core/render';
export * from './src/core/linker';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ expect(door.lock instanceof Lock).toBe(true);
// #enddocregion

// #docregion resolve_forward_ref
var ref = forwardRef(() => 'refValue');
expect(resolveForwardRef(ref)).toEqual('refValue');
expect(resolveForwardRef('regularValue')).toEqual('regularValue');
var ref = forwardRef(() => "refValue");
expect(resolveForwardRef(ref)).toEqual("refValue");
expect(resolveForwardRef("regularValue")).toEqual("regularValue");
// #enddocregion
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,15 @@ export class AsyncPipeExample {
if (this.arrived) {
this.reset();
} else {
this.resolve('hi there!');
this.resolve("hi there!");
this.arrived = true;
}
}
}
// #enddocregion

// #docregion AsyncPipeObservable
@Component({selector: 'task-cmp', template: 'Time: {{ time | async }}'})
@Component({selector: "task-cmp", template: "Time: {{ time | async }}"})
class Task {
time = new Observable<number>((observer: Subscriber<number>) => {
setInterval(() => observer.next(new Date().getTime()), 500);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
import {provide, Component} from 'angular2/core';
import {bootstrap} from 'angular2/platform/browser';
import {CanActivate, RouteConfig, ComponentInstruction, APP_BASE_HREF, ROUTER_DIRECTIVES} from 'angular2/router';
import {
CanActivate,
RouteConfig,
ComponentInstruction,
APP_BASE_HREF,
ROUTER_DIRECTIVES
} from 'angular2/router';

function checkIfWeHavePermission(instruction: ComponentInstruction) {
return instruction.params['id'] == '1';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
import {provide, Component} from 'angular2/core';
import {bootstrap} from 'angular2/platform/browser';
import {CanDeactivate, RouteConfig, RouteParams, ComponentInstruction, ROUTER_DIRECTIVES, APP_BASE_HREF} from 'angular2/router';
import {
CanDeactivate,
RouteConfig,
RouteParams,
ComponentInstruction,
ROUTER_DIRECTIVES,
APP_BASE_HREF
} from 'angular2/router';

// #docregion routerCanDeactivate
@Component({
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
import {Component, provide} from 'angular2/core';
import {bootstrap} from 'angular2/platform/browser';
import {OnActivate, ComponentInstruction, RouteConfig, ROUTER_DIRECTIVES, APP_BASE_HREF} from 'angular2/router';
import {
OnActivate,
ComponentInstruction,
RouteConfig,
ROUTER_DIRECTIVES,
APP_BASE_HREF
} from 'angular2/router';

// #docregion routerOnActivate
@Component({template: `Child`})
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
import {Component, Injectable, provide} from 'angular2/core';
import {bootstrap} from 'angular2/platform/browser';
import {OnDeactivate, ComponentInstruction, RouteConfig, ROUTER_DIRECTIVES, APP_BASE_HREF} from 'angular2/router';
import {
OnDeactivate,
ComponentInstruction,
RouteConfig,
ROUTER_DIRECTIVES,
APP_BASE_HREF
} from 'angular2/router';


@Injectable()
Expand Down Expand Up @@ -51,6 +57,7 @@ class AppCmp {

export function main() {
return bootstrap(AppCmp, [
provide(APP_BASE_HREF, {useValue: '/angular2/examples/router/ts/on_deactivate'}), LogService
provide(APP_BASE_HREF, {useValue: '/angular2/examples/router/ts/on_deactivate'}),
LogService
]);
}
15 changes: 12 additions & 3 deletions modules/angular2/examples/router/ts/reuse/reuse_example.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,15 @@
import {Component, provide} from 'angular2/core';
import {bootstrap} from 'angular2/platform/browser';
import {CanActivate, RouteConfig, ComponentInstruction, ROUTER_DIRECTIVES, APP_BASE_HREF, CanReuse, RouteParams, OnReuse} from 'angular2/router';
import {
CanActivate,
RouteConfig,
ComponentInstruction,
ROUTER_DIRECTIVES,
APP_BASE_HREF,
CanReuse,
RouteParams,
OnReuse
} from 'angular2/router';


// #docregion reuseCmp
Expand Down Expand Up @@ -44,6 +53,6 @@ class AppCmp {


export function main() {
return bootstrap(
AppCmp, [provide(APP_BASE_HREF, {useValue: '/angular2/examples/router/ts/reuse'})]);
return bootstrap(AppCmp,
[provide(APP_BASE_HREF, {useValue: '/angular2/examples/router/ts/reuse'})]);
}
25 changes: 17 additions & 8 deletions modules/angular2/examples/testing/ts/testing.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,15 @@
import {describe, fdescribe, xdescribe, it, fit, xit, beforeEach, afterEach, beforeEachProviders, inject} from 'angular2/testing';
import {
describe,
fdescribe,
xdescribe,
it,
fit,
xit,
beforeEach,
afterEach,
beforeEachProviders,
inject
} from 'angular2/testing';
import {provide} from 'angular2/core';

var db: any;
Expand All @@ -19,9 +30,8 @@ fdescribe('some component', () => {
// This test will run.
});
});
describe('another component', () => {
it('also has a test', () => { throw 'This test will not run.'; });
});
describe('another component',
() => { it('also has a test', () => { throw 'This test will not run.'; }); });
// #enddocregion

// #docregion xdescribe
Expand Down Expand Up @@ -63,10 +73,9 @@ describe('some component', () => {
// #docregion beforeEachProviders
describe('some component', () => {
beforeEachProviders(() => [provide(MyService, {useClass: MyMockService})]);
it('uses MyService', inject(
[MyService], (service: MyMockService) => {
// service is an instance of MyMockService.
}));
it('uses MyService', inject([MyService], (service: MyMockService) => {
// service is an instance of MyMockService.
}));
});
// #enddocregion

Expand Down
38 changes: 24 additions & 14 deletions modules/angular2/http.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,12 @@ import {BaseResponseOptions, ResponseOptions} from './src/http/base_response_opt
export {Request} from './src/http/static_request';
export {Response} from './src/http/static_response';

export {RequestOptionsArgs, ResponseOptionsArgs, Connection, ConnectionBackend} from './src/http/interfaces';
export {
RequestOptionsArgs,
ResponseOptionsArgs,
Connection,
ConnectionBackend
} from './src/http/interfaces';

export {BrowserXhr} from './src/http/backends/browser_xhr';
export {BaseRequestOptions, RequestOptions} from './src/http/base_request_options';
Expand Down Expand Up @@ -150,13 +155,16 @@ export {URLSearchParams} from './src/http/url_search_params';
export const HTTP_PROVIDERS: any[] = [
// TODO(pascal): use factory type annotations once supported in DI
// issue: https://github.com/angular/angular/issues/3183
provide(Http, {
useFactory: (xhrBackend: XHRBackend, requestOptions: RequestOptions) =>
new Http(xhrBackend, requestOptions),
deps: [XHRBackend, RequestOptions]
}),
BrowserXhr, provide(RequestOptions, {useClass: BaseRequestOptions}),
provide(ResponseOptions, {useClass: BaseResponseOptions}), XHRBackend
provide(Http,
{
useFactory: (xhrBackend: XHRBackend, requestOptions: RequestOptions) =>
new Http(xhrBackend, requestOptions),
deps: [XHRBackend, RequestOptions]
}),
BrowserXhr,
provide(RequestOptions, {useClass: BaseRequestOptions}),
provide(ResponseOptions, {useClass: BaseResponseOptions}),
XHRBackend
];

/**
Expand Down Expand Up @@ -276,12 +284,14 @@ export const HTTP_BINDINGS = HTTP_PROVIDERS;
export const JSONP_PROVIDERS: any[] = [
// TODO(pascal): use factory type annotations once supported in DI
// issue: https://github.com/angular/angular/issues/3183
provide(Jsonp, {
useFactory: (jsonpBackend: JSONPBackend, requestOptions: RequestOptions) =>
new Jsonp(jsonpBackend, requestOptions),
deps: [JSONPBackend, RequestOptions]
}),
BrowserJsonp, provide(RequestOptions, {useClass: BaseRequestOptions}),
provide(Jsonp,
{
useFactory: (jsonpBackend: JSONPBackend, requestOptions: RequestOptions) =>
new Jsonp(jsonpBackend, requestOptions),
deps: [JSONPBackend, RequestOptions]
}),
BrowserJsonp,
provide(RequestOptions, {useClass: BaseRequestOptions}),
provide(ResponseOptions, {useClass: BaseResponseOptions}),
provide(JSONPBackend, {useClass: JSONPBackend_})
];
Expand Down
8 changes: 7 additions & 1 deletion modules/angular2/instrumentation.ts
Original file line number Diff line number Diff line change
@@ -1 +1,7 @@
export {wtfCreateScope, wtfLeave, wtfStartTimeRange, wtfEndTimeRange, WtfScopeFn} from './src/core/profile/profile';
export {
wtfCreateScope,
wtfLeave,
wtfStartTimeRange,
wtfEndTimeRange,
WtfScopeFn
} from './src/core/profile/profile';
21 changes: 18 additions & 3 deletions modules/angular2/platform/browser.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,27 @@
export {AngularEntrypoint} from 'angular2/src/core/angular_entrypoint';
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';
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';

import {Type, isPresent, CONST_EXPR} from 'angular2/src/facade/lang';
import {BROWSER_PROVIDERS, BROWSER_APP_COMMON_PROVIDERS} from 'angular2/src/platform/browser_common';
import {
BROWSER_PROVIDERS,
BROWSER_APP_COMMON_PROVIDERS
} from 'angular2/src/platform/browser_common';
import {COMPILER_PROVIDERS} from 'angular2/compiler';
import {ComponentRef, platform, reflector} from 'angular2/core';
import {ReflectionCapabilities} from 'angular2/src/core/reflection/reflection_capabilities';
import {XHRImpl} from 'angular2/src/platform/browser/xhr_impl';
import {XHRImpl} from "angular2/src/platform/browser/xhr_impl";
import {XHR} from 'angular2/compiler';
import {Provider} from 'angular2/src/core/di';

Expand Down
23 changes: 18 additions & 5 deletions modules/angular2/platform/browser_static.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,21 @@
export {AngularEntrypoint} from 'angular2/src/core/angular_entrypoint';
export {BROWSER_PROVIDERS, ELEMENT_PROBE_PROVIDERS, ELEMENT_PROBE_PROVIDERS_PROD_MODE, inspectNativeElement, BrowserDomAdapter, By, Title, enableDebugTools, disableDebugTools} from 'angular2/src/platform/browser_common';
export {
BROWSER_PROVIDERS,
ELEMENT_PROBE_PROVIDERS,
ELEMENT_PROBE_PROVIDERS_PROD_MODE,
inspectNativeElement,
BrowserDomAdapter,
By,
Title,
enableDebugTools,
disableDebugTools
} from 'angular2/src/platform/browser_common';

import {Type, isPresent} from 'angular2/src/facade/lang';
import {BROWSER_PROVIDERS, BROWSER_APP_COMMON_PROVIDERS} from 'angular2/src/platform/browser_common';
import {
BROWSER_PROVIDERS,
BROWSER_APP_COMMON_PROVIDERS
} from 'angular2/src/platform/browser_common';
import {ComponentRef, platform} from 'angular2/core';

/**
Expand All @@ -16,9 +29,9 @@ export const BROWSER_APP_PROVIDERS: Array<any /*Type | Provider | any[]*/> =
/**
* See {@link bootstrap} for more information.
*/
export function bootstrapStatic(
appComponentType: Type, customProviders?: Array<any /*Type | Provider | any[]*/>,
initReflector?: Function): Promise<ComponentRef> {
export function bootstrapStatic(appComponentType: Type,
customProviders?: Array<any /*Type | Provider | any[]*/>,
initReflector?: Function): Promise<ComponentRef> {
if (isPresent(initReflector)) {
initReflector();
}
Expand Down
6 changes: 5 additions & 1 deletion modules/angular2/platform/common_dom.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ export {DomRenderer} from 'angular2/src/platform/dom/dom_renderer';
export {DOCUMENT} from 'angular2/src/platform/dom/dom_tokens';
export {SharedStylesHost, DomSharedStylesHost} from 'angular2/src/platform/dom/shared_styles_host';
export {DomEventsPlugin} from 'angular2/src/platform/dom/events/dom_events';
export {EVENT_MANAGER_PLUGINS, EventManager, EventManagerPlugin} from 'angular2/src/platform/dom/events/event_manager';
export {
EVENT_MANAGER_PLUGINS,
EventManager,
EventManagerPlugin
} from 'angular2/src/platform/dom/events/event_manager';
export * from 'angular2/src/platform/dom/debug/by';
export * from 'angular2/src/platform/dom/debug/ng_probe';
Loading

0 comments on commit 60727c4

Please sign in to comment.