fix(platform-browser-dynamic): Rename CACHED_TEMPLATE_PROVIDER to RESOURCE_CACHE_PROVIDER (#10866)

* fix(platform-browser-dynamic): Rename CACHED_TEMPLATE_PROVIDER to RESOURCE_CACHE_PROVIDER

Closes #9741

BREAKING CHANGE:

`CACHED_TEMPLATE_PROVIDER` is now renamed to `RESOURCE_CACHE_PROVIDER`

Before:

```js
import {CACHED_TEMPLATE_PROVIDER} from '@angular/platform-browser-dynamic';
```

After:

```js
import {RESOURCE_CACHE_PROVIDER} from '@angular/platform-browser-dynamic';
```

* Rename XHR -> ResourceLoader
This commit is contained in:
Hans
2016-08-17 09:24:44 -07:00
committed by vikerman
parent 951ecb4d90
commit 40e160c22c
29 changed files with 213 additions and 190 deletions

View File

@ -6,21 +6,22 @@
* found in the LICENSE file at https://angular.io/license
*/
import {XHR, analyzeAppProvidersForDeprecatedConfiguration, platformCoreDynamic} from '@angular/compiler';
import {ResourceLoader, analyzeAppProvidersForDeprecatedConfiguration, platformCoreDynamic} from '@angular/compiler';
import {ApplicationRef, COMPILER_OPTIONS, CUSTOM_ELEMENTS_SCHEMA, CompilerFactory, CompilerOptions, ComponentRef, NgModule, PlatformRef, Provider, Type, createPlatformFactory} from '@angular/core';
import {BrowserModule, WORKER_SCRIPT, WorkerAppModule, platformWorkerUi} from '@angular/platform-browser';
import {Console} from './core_private';
import {INTERNAL_BROWSER_DYNAMIC_PLATFORM_PROVIDERS} from './src/platform_providers';
import {CachedXHR} from './src/xhr/xhr_cache';
import {XHRImpl} from './src/xhr/xhr_impl';
import {CachedResourceLoader} from './src/resource_loader/resource_loader_cache';
import {ResourceLoaderImpl} from './src/resource_loader/resource_loader_impl';
/**
* @experimental
*/
export const CACHED_TEMPLATE_PROVIDER: Provider[] = [{provide: XHR, useClass: CachedXHR}];
export const RESOURCE_CACHE_PROVIDER: Provider[] =
[{provide: ResourceLoader, useClass: CachedResourceLoader}];
/**
* @experimental API related to bootstrapping are still under review.
@ -46,12 +47,12 @@ export function bootstrapWorkerUi(
/**
* @experimental API related to bootstrapping are still under review.
*/
export const platformWorkerAppDynamic =
createPlatformFactory(platformCoreDynamic, 'workerAppDynamic', [{
provide: COMPILER_OPTIONS,
useValue: {providers: [{provide: XHR, useClass: XHRImpl}]},
multi: true
}]);
export const platformWorkerAppDynamic = createPlatformFactory(
platformCoreDynamic, 'workerAppDynamic', [{
provide: COMPILER_OPTIONS,
useValue: {providers: [{provide: ResourceLoader, useClass: ResourceLoaderImpl}]},
multi: true
}]);
function normalizeArray(arr: any[]): any[] {
return arr ? arr : [];