Skip to content

Commit

Permalink
Remove navigator definition and put it in the zone mapper
Browse files Browse the repository at this point in the history
  • Loading branch information
clbond committed Mar 24, 2017
1 parent 3342dc8 commit 57d563a
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 20 deletions.
2 changes: 1 addition & 1 deletion package.json
@@ -1,6 +1,6 @@
{
"name": "angular-ssr",
"version": "0.0.65",
"version": "0.0.66",
"description": "Angular server-side rendering implementation",
"main": "build/index.js",
"typings": "build/index.d.ts",
Expand Down
1 change: 0 additions & 1 deletion source/application/operation.ts
Expand Up @@ -47,7 +47,6 @@ export interface RenderOperation<M> {
export interface RenderVariantOperation<M, V> {
scope: RenderOperation<M>; /// parent render scope
uri: string; /// an absolute URI including protocol and hostname
locale?: string; /// optional locale (navigator.language will return this value to the application)
variant?: V; /// variant options for this render operation
transition?: ComposedTransition; /// variant transition function composed from {@link VariantMap} and {@link variant}
}
8 changes: 4 additions & 4 deletions source/platform/zone/environment.ts
Expand Up @@ -56,9 +56,6 @@ Object.defineProperties(environment, {
location: {
get: () => fromInjectable<PlatformLocation>(PlatformLocation),
},
window: {
get: () => fromInjectable<Window>(DocumentContainer, c => c.window),
},
navigator: {
get: () => {
return {
Expand All @@ -73,7 +70,10 @@ Object.defineProperties(environment, {
}
};
}
}
},
window: {
get: () => fromInjectable<Window>(DocumentContainer, c => c.window),
},
});

if (environment.System == null) { // ng cli only
Expand Down
14 changes: 0 additions & 14 deletions source/runtime.ts
Expand Up @@ -31,18 +31,4 @@ Object.assign(global, {MutationObserver: MutationObserverImpl});

Object.assign(global, {CSS: null});

const navigatorImpl = {
get userAgent() {
return 'Chrome';
},
get language() {
return 'en-US';
},
get cookieEnabled() {
return false;
}
};

Object.assign(global, {navigator: navigatorImpl});

require('mock-local-storage');

0 comments on commit 57d563a

Please sign in to comment.