fix(browser): platform code cleanup
This commit is contained in:
@ -1,3 +1,3 @@
|
||||
import {OpaqueToken} from '@angular/core';
|
||||
|
||||
export const ON_WEB_WORKER = /*@ts2dart_const*/ new OpaqueToken('WebWorker.onWebWorker');
|
||||
export const ON_WEB_WORKER = new OpaqueToken('WebWorker.onWebWorker');
|
||||
|
@ -8,7 +8,7 @@ import {LocationType} from './serialized_types';
|
||||
|
||||
// PRIMITIVE is any type that does not need to be serialized (string, number, boolean)
|
||||
// We set it to String so that it is considered a Type.
|
||||
export const PRIMITIVE: Type = /*@ts2dart_const*/ String;
|
||||
export const PRIMITIVE: Type = String;
|
||||
|
||||
@Injectable()
|
||||
export class Serializer {
|
||||
|
@ -6,10 +6,10 @@ import {APP_INITIALIZER, Injector, NgZone} from '@angular/core';
|
||||
* A list of {@link Provider}s. To use the router in a Worker enabled application you must
|
||||
* include these providers when setting up the render thread.
|
||||
*/
|
||||
export const WORKER_RENDER_LOCATION_PROVIDERS = /*@ts2dart_const*/[
|
||||
export const WORKER_RENDER_LOCATION_PROVIDERS = [
|
||||
MessageBasedPlatformLocation,
|
||||
BrowserPlatformLocation,
|
||||
/* @ts2dart_Provider */ {provide: APP_INITIALIZER, useFactory: initUiLocation, multi: true, deps: [Injector]}
|
||||
{provide: APP_INITIALIZER, useFactory: initUiLocation, multi: true, deps: [Injector]}
|
||||
];
|
||||
|
||||
function initUiLocation(injector: Injector): () => void {
|
||||
|
@ -6,8 +6,8 @@ import {WebWorkerPlatformLocation} from './platform_location';
|
||||
* Those providers should be added when the router is used in a worker context in addition to the
|
||||
* {@link ROUTER_PROVIDERS} and after them.
|
||||
*/
|
||||
export const WORKER_APP_LOCATION_PROVIDERS = /*@ts2dart_const*/[
|
||||
/* @ts2dart_Provider */ {provide: PlatformLocation, useClass: WebWorkerPlatformLocation},
|
||||
export const WORKER_APP_LOCATION_PROVIDERS = [
|
||||
{provide: PlatformLocation, useClass: WebWorkerPlatformLocation},
|
||||
{
|
||||
provide: APP_INITIALIZER,
|
||||
useFactory: (platformLocation: WebWorkerPlatformLocation, zone: NgZone) => () =>
|
||||
|
Reference in New Issue
Block a user