refactor(application): rename Binding into Provider
while creating the server version I noticed bindings are still mentioned Closes #4951
This commit is contained in:
@ -38,13 +38,13 @@ import {EXCEPTION_PROVIDER} from './platform_bindings';
|
||||
import {AnimationBuilder} from 'angular2/src/animate/animation_builder';
|
||||
import {BrowserDetails} from 'angular2/src/animate/browser_details';
|
||||
import {wtfInit} from './profile/wtf_init';
|
||||
import {platformCommon, PlatformRef, applicationCommonBindings} from './application_ref';
|
||||
import {platformCommon, PlatformRef, applicationCommonProviders} from './application_ref';
|
||||
|
||||
/**
|
||||
* A default set of providers which apply only to an Angular application running on
|
||||
* the UI thread.
|
||||
*/
|
||||
export function applicationDomBindings(): Array<Type | Provider | any[]> {
|
||||
export function applicationDomProviders(): Array<Type | Provider | any[]> {
|
||||
if (isBlank(DOM)) {
|
||||
throw "Must set a root DOM adapter first.";
|
||||
}
|
||||
@ -77,7 +77,7 @@ export function applicationDomBindings(): Array<Type | Provider | any[]> {
|
||||
* If no providers are specified, `platform`'s behavior depends on whether an existing
|
||||
* platform exists:
|
||||
*
|
||||
* If no platform exists, a new one will be created with the default {@link platformBindings}.
|
||||
* If no platform exists, a new one will be created with the default {@link platformProviders}.
|
||||
*
|
||||
* If a platform already exists, it will be returned (regardless of what providers it
|
||||
* was created with). This is a convenience feature, allowing for multiple applications
|
||||
@ -100,8 +100,8 @@ export function applicationDomBindings(): Array<Type | Provider | any[]> {
|
||||
* DOM access. Web-worker applications should call `platform` from
|
||||
* `src/web_workers/worker/application_common` instead.
|
||||
*/
|
||||
export function platform(bindings?: Array<Type | Provider | any[]>): PlatformRef {
|
||||
return platformCommon(bindings, () => {
|
||||
export function platform(providers?: Array<Type | Provider | any[]>): PlatformRef {
|
||||
return platformCommon(providers, () => {
|
||||
BrowserDomAdapter.makeCurrent();
|
||||
wtfInit();
|
||||
BrowserGetTestability.init();
|
||||
@ -219,12 +219,12 @@ export function platform(bindings?: Array<Type | Provider | any[]>): PlatformRef
|
||||
* Returns a `Promise` of {@link ComponentRef}.
|
||||
*/
|
||||
export function commonBootstrap(appComponentType: /*Type*/ any,
|
||||
appBindings: Array<Type | Provider | any[]> = null):
|
||||
appProviders: Array<Type | Provider | any[]> = null):
|
||||
Promise<ComponentRef> {
|
||||
var p = platform();
|
||||
var bindings = [applicationCommonBindings(), applicationDomBindings()];
|
||||
if (isPresent(appBindings)) {
|
||||
bindings.push(appBindings);
|
||||
var bindings = [applicationCommonProviders(), applicationDomProviders()];
|
||||
if (isPresent(appProviders)) {
|
||||
bindings.push(appProviders);
|
||||
}
|
||||
return p.application(bindings).bootstrap(appComponentType);
|
||||
}
|
||||
|
Reference in New Issue
Block a user