From 3529813ca0d055a4331cc627a331d8fb7124f278 Mon Sep 17 00:00:00 2001 From: Peter Bacon Darwin Date: Sun, 5 Mar 2017 19:58:55 +0000 Subject: [PATCH] fix(aio): move interfaces into their own files to workaround compile weirdness For some reason the tree-shaker is not picking up these interfaces (perhaps TS is not passing it through) when they are in the same file as their related services. This results in a distracting warning message. --- aio/src/app/documents/document-contents.ts | 4 ++++ aio/src/app/documents/document.service.ts | 7 ++----- aio/src/app/navigation/navigation-node.ts | 7 +++++++ aio/src/app/navigation/navigation.service.ts | 9 ++------- 4 files changed, 15 insertions(+), 12 deletions(-) create mode 100644 aio/src/app/documents/document-contents.ts create mode 100644 aio/src/app/navigation/navigation-node.ts diff --git a/aio/src/app/documents/document-contents.ts b/aio/src/app/documents/document-contents.ts new file mode 100644 index 0000000000..80b03a4f2e --- /dev/null +++ b/aio/src/app/documents/document-contents.ts @@ -0,0 +1,4 @@ +export interface DocumentContents { + title: string; + contents: string; +} diff --git a/aio/src/app/documents/document.service.ts b/aio/src/app/documents/document.service.ts index bbc68ea013..3a8845c8e0 100644 --- a/aio/src/app/documents/document.service.ts +++ b/aio/src/app/documents/document.service.ts @@ -7,14 +7,11 @@ import 'rxjs/add/operator/switchMap'; import { LocationService } from 'app/shared/location.service'; import { Logger } from 'app/shared/logger.service'; +import { DocumentContents } from './document-contents'; +export { DocumentContents } from './document-contents'; const FILE_NOT_FOUND_URL = 'file-not-found'; -export interface DocumentContents { - title: string; - contents: string; -} - @Injectable() export class DocumentService { diff --git a/aio/src/app/navigation/navigation-node.ts b/aio/src/app/navigation/navigation-node.ts new file mode 100644 index 0000000000..32fad09bae --- /dev/null +++ b/aio/src/app/navigation/navigation-node.ts @@ -0,0 +1,7 @@ +export interface NavigationNode { + url?: string; + title?: string; + tooltip?: string; + target?: string; + children?: NavigationNode[]; +} diff --git a/aio/src/app/navigation/navigation.service.ts b/aio/src/app/navigation/navigation.service.ts index 6ddda0b8ee..652880c140 100644 --- a/aio/src/app/navigation/navigation.service.ts +++ b/aio/src/app/navigation/navigation.service.ts @@ -7,13 +7,8 @@ import 'rxjs/add/operator/publish'; import { Logger } from 'app/shared/logger.service'; import { LocationService } from 'app/shared/location.service'; -export interface NavigationNode { - url?: string; - title?: string; - tooltip?: string; - target?: string; - children?: NavigationNode[]; -} +import { NavigationNode } from './navigation-node'; +export { NavigationNode } from './navigation-node'; export interface NavigationViews { [name: string]: NavigationNode[];