From 5279d06e88f17d8e9adec367e2bbee3ae2d9c7d3 Mon Sep 17 00:00:00 2001 From: Alex Eagle Date: Fri, 10 Feb 2017 16:29:30 -0800 Subject: [PATCH] ci: re-format sources (#14413) PR Close #14413 --- .../@angular/platform-server/src/location.ts | 36 +++++++------------ .../platform-server/test/integration_spec.ts | 4 +-- 2 files changed, 15 insertions(+), 25 deletions(-) diff --git a/modules/@angular/platform-server/src/location.ts b/modules/@angular/platform-server/src/location.ts index 3aa2b81b5f..56dafb10a6 100644 --- a/modules/@angular/platform-server/src/location.ts +++ b/modules/@angular/platform-server/src/location.ts @@ -6,14 +6,14 @@ * found in the LICENSE file at https://angular.io/license */ +import {LocationChangeEvent, LocationChangeListener, PlatformLocation} from '@angular/common'; +import {Injectable} from '@angular/core'; +import {Subject} from 'rxjs/Subject'; import * as url from 'url'; -import {Injectable} from '@angular/core'; -import {LocationChangeEvent, LocationChangeListener, PlatformLocation} from '@angular/common'; -import {getDOM} from './private_import_platform-browser'; import {scheduleMicroTask} from './facade/lang'; +import {getDOM} from './private_import_platform-browser'; -import {Subject} from 'rxjs/Subject'; /** @@ -27,26 +27,20 @@ export class ServerPlatformLocation implements PlatformLocation { private _hash: string = ''; private _hashUpdate = new Subject(); - getBaseHrefFromDOM(): string { - return getDOM().getBaseHref(); - } - + getBaseHrefFromDOM(): string { return getDOM().getBaseHref(); } + onPopState(fn: LocationChangeListener): void { // No-op: a state stack is not implemented, so // no events will ever come. } - - onHashChange(fn: LocationChangeListener): void { - this._hashUpdate.subscribe(fn); - } + + onHashChange(fn: LocationChangeListener): void { this._hashUpdate.subscribe(fn); } get pathname(): string { return this._path; } get search(): string { return this._search; } get hash(): string { return this._hash; } - get url(): string { - return `${this.pathname}${this.search}${this.hash}`; - } + get url(): string { return `${this.pathname}${this.search}${this.hash}`; } private setHash(value: string, oldUrl: string) { if (this._hash === value) { @@ -55,8 +49,8 @@ export class ServerPlatformLocation implements PlatformLocation { } this._hash = value; const newUrl = this.url; - scheduleMicroTask(() => this._hashUpdate.next( - {type: 'hashchange', oldUrl, newUrl} as LocationChangeEvent)); + scheduleMicroTask( + () => this._hashUpdate.next({ type: 'hashchange', oldUrl, newUrl } as LocationChangeEvent)); } replaceState(state: any, title: string, newUrl: string): void { @@ -71,11 +65,7 @@ export class ServerPlatformLocation implements PlatformLocation { this.replaceState(state, title, newUrl); } - forward(): void { - throw new Error('Not implemented'); - } + forward(): void { throw new Error('Not implemented'); } - back(): void { - throw new Error('Not implemented'); - } + back(): void { throw new Error('Not implemented'); } } diff --git a/modules/@angular/platform-server/test/integration_spec.ts b/modules/@angular/platform-server/test/integration_spec.ts index 319e899566..e7938515b7 100644 --- a/modules/@angular/platform-server/test/integration_spec.ts +++ b/modules/@angular/platform-server/test/integration_spec.ts @@ -6,8 +6,8 @@ * found in the LICENSE file at https://angular.io/license */ -import {Component, NgModule, destroyPlatform} from '@angular/core'; import {PlatformLocation} from '@angular/common'; +import {Component, NgModule, destroyPlatform} from '@angular/core'; import {async} from '@angular/core/testing'; import {getDOM} from '@angular/platform-browser/src/dom/dom_adapter'; import {ServerModule, platformDynamicServer} from '@angular/platform-server'; @@ -43,7 +43,7 @@ export function main() { expect(getDOM().getText(body)).toEqual('Works!'); }); })); - + describe('PlatformLocation', () => { it('is injectable', () => { const body = writeBody('');