fix: split dynamic bits in platform-browser into platform-browser-dynamic
Previously these symbols were exposed via platform-browser-dynamic, then we merged then into platform-browser thinking that tools would know how to shake off the compiler and other dynamic bits not used with the offline compilation flow. This turned out to be wrong as both webpack and rollup don't have good enough tree-shaking capabilities to do this today. We think that in the future we'll be able to merge these two entry points into one, but we need to give tooling some time before we can do it. In the meantime the reintroduction of the -dynamic package point allows us to separate the compiler dependencies from the rest of the framework. This change undoes the previous breaking change that removed the platform-browser-dynamic package.
This commit is contained in:
parent
ac84468f1c
commit
6fc267f22c
|
@ -1,7 +1,6 @@
|
|||
import {ElementSchemaRegistry, UrlResolver, XHR} from '@angular/compiler';
|
||||
import {createUrlResolverWithoutPackagePrefix} from '@angular/compiler/src/url_resolver';
|
||||
import {MockSchemaRegistry, MockXHR} from '@angular/compiler/testing';
|
||||
import {provide} from '@angular/core';
|
||||
|
||||
export var TEST_PROVIDERS: any[] = [
|
||||
{provide: ElementSchemaRegistry, useValue: new MockSchemaRegistry({}, {})},
|
||||
|
|
|
@ -17,7 +17,7 @@ import {EventEmitter, ObservableWrapper} from '../../src/facade/async';
|
|||
|
||||
|
||||
import {Component, DebugElement, Directive, TemplateRef, ChangeDetectorRef, ViewContainerRef, Input, Output, forwardRef, ViewMetadata, Pipe, RootRenderer, Renderer, RenderComponentType, Injectable, provide, OnInit, DoCheck, OnChanges, AfterContentInit, AfterContentChecked, AfterViewInit, AfterViewChecked} from '@angular/core';
|
||||
import {NgFor} from '@angular/common';
|
||||
import {NgFor, NgIf} from '@angular/common';
|
||||
import {By} from '@angular/platform-browser/src/dom/debug/by';
|
||||
import {AsyncPipe} from '@angular/common';
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import {UrlResolver} from '@angular/compiler';
|
||||
import {provide} from '@angular/core';
|
||||
import {bootstrap} from '@angular/platform-browser';
|
||||
import {bootstrap} from '@angular/platform-browser-dynamic';
|
||||
|
||||
var MyApp: any;
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import {NG_VALIDATORS} from '@angular/common';
|
||||
import {bootstrap} from '@angular/platform-browser';
|
||||
import {bootstrap} from '@angular/platform-browser-dynamic';
|
||||
|
||||
let MyApp: Function = null;
|
||||
let myValidator: any = null;
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import {Component, provide} from '@angular/core';
|
||||
import {bootstrap} from '@angular/platform-browser';
|
||||
import {Component} from '@angular/core';
|
||||
import {bootstrap} from '@angular/platform-browser-dynamic';
|
||||
import {Observable, Subscriber} from 'rxjs/Rx';
|
||||
|
||||
// #docregion AsyncPipePromise
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import {Component, provide} from '@angular/core';
|
||||
import {bootstrap} from '@angular/platform-browser';
|
||||
import {Component} from '@angular/core';
|
||||
import {bootstrap} from '@angular/platform-browser-dynamic';
|
||||
|
||||
// #docregion DatePipe
|
||||
@Component({
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import {Component, provide} from '@angular/core';
|
||||
import {bootstrap} from '@angular/platform-browser';
|
||||
import {Component} from '@angular/core';
|
||||
import {bootstrap} from '@angular/platform-browser-dynamic';
|
||||
|
||||
// #docregion JsonPipe
|
||||
@Component({
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import {Component, provide} from '@angular/core';
|
||||
import {bootstrap} from '@angular/platform-browser';
|
||||
import {Component} from '@angular/core';
|
||||
import {bootstrap} from '@angular/platform-browser-dynamic';
|
||||
|
||||
// #docregion LowerUpperPipe
|
||||
@Component({
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import {Component, provide} from '@angular/core';
|
||||
import {bootstrap} from '@angular/platform-browser';
|
||||
import {Component} from '@angular/core';
|
||||
import {bootstrap} from '@angular/platform-browser-dynamic';
|
||||
|
||||
// #docregion NumberPipe
|
||||
@Component({
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import {Component, provide} from '@angular/core';
|
||||
import {bootstrap} from '@angular/platform-browser';
|
||||
import {Component} from '@angular/core';
|
||||
import {bootstrap} from '@angular/platform-browser-dynamic';
|
||||
|
||||
// #docregion SlicePipe_string
|
||||
@Component({
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import {Component} from '@angular/core';
|
||||
import {bootstrap} from '@angular/platform-browser';
|
||||
import {bootstrap} from '@angular/platform-browser-dynamic';
|
||||
|
||||
// #docregion bootstrap
|
||||
@Component({selector: 'my-app', template: 'Hello {{ name }}!'})
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
// #docregion enableProdMode
|
||||
import {enableProdMode} from '@angular/core';
|
||||
import {bootstrap} from '@angular/platform-browser';
|
||||
import {bootstrap} from '@angular/platform-browser-dynamic';
|
||||
import {MyComponent} from './my_component';
|
||||
|
||||
enableProdMode();
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
import {Component} from '@angular/core';
|
||||
import {ELEMENT_PROBE_PROVIDERS, bootstrap} from '@angular/platform-browser';
|
||||
import {ELEMENT_PROBE_PROVIDERS} from '@angular/platform-browser';
|
||||
import {bootstrap} from '@angular/platform-browser-dynamic';
|
||||
|
||||
@Component({selector: 'my-component'})
|
||||
class MyAppComponent {
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import {APP_BASE_HREF} from '@angular/common';
|
||||
import {Component, ComponentRef} from '@angular/core';
|
||||
import {bootstrap} from '@angular/platform-browser';
|
||||
import {bootstrap} from '@angular/platform-browser-dynamic';
|
||||
import {CanActivate, ComponentInstruction, ROUTER_DIRECTIVES, RouteConfig} from '@angular/router-deprecated';
|
||||
|
||||
function checkIfWeHavePermission(instruction: ComponentInstruction) {
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import {APP_BASE_HREF} from '@angular/common';
|
||||
import {Component, ComponentRef, provide} from '@angular/core';
|
||||
import {bootstrap} from '@angular/platform-browser';
|
||||
import {bootstrap} from '@angular/platform-browser-dynamic';
|
||||
import {CanDeactivate, ComponentInstruction, ROUTER_DIRECTIVES, RouteConfig, RouteParams} from '@angular/router-deprecated';
|
||||
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import {APP_BASE_HREF} from '@angular/common';
|
||||
import {Component, ComponentRef, provide} from '@angular/core';
|
||||
import {bootstrap} from '@angular/platform-browser';
|
||||
import {bootstrap} from '@angular/platform-browser-dynamic';
|
||||
import {ComponentInstruction, OnActivate, ROUTER_DIRECTIVES, RouteConfig} from '@angular/router-deprecated';
|
||||
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import {APP_BASE_HREF} from '@angular/common';
|
||||
import {Component, ComponentRef, Injectable} from '@angular/core';
|
||||
import {bootstrap} from '@angular/platform-browser';
|
||||
import {bootstrap} from '@angular/platform-browser-dynamic';
|
||||
import {ComponentInstruction, OnDeactivate, ROUTER_DIRECTIVES, RouteConfig} from '@angular/router-deprecated';
|
||||
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import {APP_BASE_HREF} from '@angular/common';
|
||||
import {Component, ComponentRef} from '@angular/core';
|
||||
import {bootstrap} from '@angular/platform-browser';
|
||||
import {bootstrap} from '@angular/platform-browser-dynamic';
|
||||
import {CanReuse, ComponentInstruction, OnReuse, ROUTER_DIRECTIVES, RouteConfig, RouteParams} from '@angular/router-deprecated';
|
||||
|
||||
|
||||
|
|
|
@ -0,0 +1,4 @@
|
|||
import {__core_private__ as r, __core_private_types__ as t} from '@angular/core';
|
||||
|
||||
export var ReflectionCapabilities: typeof t.ReflectionCapabilities = r.ReflectionCapabilities;
|
||||
export var reflector: typeof t.reflector = r.reflector;
|
|
@ -1,10 +1,148 @@
|
|||
import {BROWSER_APP_COMPILER_PROVIDERS, BROWSER_APP_PROVIDERS} from '@angular/platform-browser';
|
||||
import {COMMON_DIRECTIVES, COMMON_PIPES} from '@angular/common';
|
||||
import {COMPILER_PROVIDERS, CompilerConfig, XHR} from '@angular/compiler';
|
||||
import {ApplicationRef, ComponentRef, ReflectiveInjector, Type, coreLoadAndBootstrap} from '@angular/core';
|
||||
import {BROWSER_APP_PROVIDERS, WORKER_APP_APPLICATION_PROVIDERS, WORKER_RENDER_APPLICATION_PROVIDERS, WORKER_SCRIPT, browserPlatform, workerAppPlatform, workerRenderPlatform} from '@angular/platform-browser';
|
||||
|
||||
export {CACHED_TEMPLATE_PROVIDER, bootstrap} from '@angular/platform-browser';
|
||||
import {ReflectionCapabilities, reflector} from './core_private';
|
||||
import {PromiseWrapper} from './src/facade/async';
|
||||
import {isPresent} from './src/facade/lang';
|
||||
import {CachedXHR} from './src/xhr/xhr_cache';
|
||||
import {XHRImpl} from './src/xhr/xhr_impl';
|
||||
|
||||
|
||||
/* @deprecated the platform-browser-dynamic module is deprecated. */
|
||||
export const BROWSER_APP_DYNAMIC_PROVIDERS: Array<any /*Type | Provider | any[]*/> =
|
||||
[BROWSER_APP_PROVIDERS, BROWSER_APP_COMPILER_PROVIDERS];
|
||||
export const BROWSER_APP_COMPILER_PROVIDERS: Array<any /*Type | Provider | any[]*/> = [
|
||||
COMPILER_PROVIDERS,
|
||||
{
|
||||
provide: CompilerConfig,
|
||||
useValue:
|
||||
new CompilerConfig({platformDirectives: COMMON_DIRECTIVES, platformPipes: COMMON_PIPES})
|
||||
},
|
||||
{provide: XHR, useClass: XHRImpl},
|
||||
];
|
||||
|
||||
console.log(`platform-browser-dynamic is deprecated, use platform-browser instead`);
|
||||
|
||||
export const CACHED_TEMPLATE_PROVIDER: Array<any /*Type | Provider | any[]*/> =
|
||||
[{provide: XHR, useClass: CachedXHR}];
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Bootstrapping for Angular applications.
|
||||
*
|
||||
* You instantiate an Angular application by explicitly specifying a component to use
|
||||
* as the root component for your application via the `bootstrap()` method.
|
||||
*
|
||||
* ## Simple Example
|
||||
*
|
||||
* Assuming this `index.html`:
|
||||
*
|
||||
* ```html
|
||||
* <html>
|
||||
* <!-- load Angular script tags here. -->
|
||||
* <body>
|
||||
* <my-app>loading...</my-app>
|
||||
* </body>
|
||||
* </html>
|
||||
* ```
|
||||
*
|
||||
* An application is bootstrapped inside an existing browser DOM, typically `index.html`.
|
||||
* Unlike Angular 1, Angular 2 does not compile/process providers in `index.html`. This is
|
||||
* mainly for security reasons, as well as architectural changes in Angular 2. This means
|
||||
* that `index.html` can safely be processed using server-side technologies such as
|
||||
* providers. Bindings can thus use double-curly `{{ syntax }}` without collision from
|
||||
* Angular 2 component double-curly `{{ syntax }}`.
|
||||
*
|
||||
* We can use this script code:
|
||||
*
|
||||
* {@example core/ts/bootstrap/bootstrap.ts region='bootstrap'}
|
||||
*
|
||||
* When the app developer invokes `bootstrap()` with the root component `MyApp` as its
|
||||
* argument, Angular performs the following tasks:
|
||||
*
|
||||
* 1. It uses the component's `selector` property to locate the DOM element which needs
|
||||
* to be upgraded into the angular component.
|
||||
* 2. It creates a new child injector (from the platform injector). Optionally, you can
|
||||
* also override the injector configuration for an app by invoking `bootstrap` with the
|
||||
* `componentInjectableBindings` argument.
|
||||
* 3. It creates a new `Zone` and connects it to the angular application's change detection
|
||||
* domain instance.
|
||||
* 4. It creates an emulated or shadow DOM on the selected component's host element and loads the
|
||||
* template into it.
|
||||
* 5. It instantiates the specified component.
|
||||
* 6. Finally, Angular performs change detection to apply the initial data providers for the
|
||||
* application.
|
||||
*
|
||||
*
|
||||
* ## Bootstrapping Multiple Applications
|
||||
*
|
||||
* When working within a browser window, there are many singleton resources: cookies, title,
|
||||
* location, and others. Angular services that represent these resources must likewise be
|
||||
* shared across all Angular applications that occupy the same browser window. For this
|
||||
* reason, Angular creates exactly one global platform object which stores all shared
|
||||
* services, and each angular application injector has the platform injector as its parent.
|
||||
*
|
||||
* Each application has its own private injector as well. When there are multiple
|
||||
* applications on a page, Angular treats each application injector's services as private
|
||||
* to that application.
|
||||
*
|
||||
* ## API
|
||||
*
|
||||
* - `appComponentType`: The root component which should act as the application. This is
|
||||
* a reference to a `Type` which is annotated with `@Component(...)`.
|
||||
* - `customProviders`: An additional set of providers that can be added to the
|
||||
* app injector to override default injection behavior.
|
||||
*
|
||||
* Returns a `Promise` of {@link ComponentRef}.
|
||||
*/
|
||||
export function bootstrap(
|
||||
appComponentType: Type,
|
||||
customProviders?: Array<any /*Type | Provider | any[]*/>): Promise<ComponentRef<any>> {
|
||||
reflector.reflectionCapabilities = new ReflectionCapabilities();
|
||||
let providers = [
|
||||
BROWSER_APP_PROVIDERS, BROWSER_APP_COMPILER_PROVIDERS,
|
||||
isPresent(customProviders) ? customProviders : []
|
||||
];
|
||||
var appInjector = ReflectiveInjector.resolveAndCreate(providers, browserPlatform().injector);
|
||||
return coreLoadAndBootstrap(appComponentType, appInjector);
|
||||
}
|
||||
|
||||
|
||||
export function bootstrapRender(
|
||||
workerScriptUri: string,
|
||||
customProviders?: Array<any /*Type | Provider | any[]*/>): Promise<ApplicationRef> {
|
||||
var app = ReflectiveInjector.resolveAndCreate(
|
||||
[
|
||||
WORKER_RENDER_APPLICATION_PROVIDERS, BROWSER_APP_COMPILER_PROVIDERS,
|
||||
{provide: WORKER_SCRIPT, useValue: workerScriptUri},
|
||||
isPresent(customProviders) ? customProviders : []
|
||||
],
|
||||
workerRenderPlatform().injector);
|
||||
// Return a promise so that we keep the same semantics as Dart,
|
||||
// and we might want to wait for the app side to come up
|
||||
// in the future...
|
||||
return PromiseWrapper.resolve(app.get(ApplicationRef));
|
||||
}
|
||||
|
||||
|
||||
const WORKER_APP_COMPILER_PROVIDERS: Array<any /*Type | Provider | any[]*/> = [
|
||||
COMPILER_PROVIDERS,
|
||||
{
|
||||
provide: CompilerConfig,
|
||||
useValue:
|
||||
new CompilerConfig({platformDirectives: COMMON_DIRECTIVES, platformPipes: COMMON_PIPES})
|
||||
},
|
||||
{provide: XHR, useClass: XHRImpl},
|
||||
];
|
||||
|
||||
|
||||
export function bootstrapApp(
|
||||
appComponentType: Type,
|
||||
customProviders?: Array<any /*Type | Provider | any[]*/>): Promise<ComponentRef<any>> {
|
||||
var appInjector = ReflectiveInjector.resolveAndCreate(
|
||||
[
|
||||
WORKER_APP_APPLICATION_PROVIDERS, WORKER_APP_COMPILER_PROVIDERS,
|
||||
isPresent(customProviders) ? customProviders : []
|
||||
],
|
||||
workerAppPlatform().injector);
|
||||
return coreLoadAndBootstrap(appComponentType, appInjector);
|
||||
}
|
||||
|
|
|
@ -0,0 +1,3 @@
|
|||
import {__platform_browser_private__ as r, __platform_browser_private__ as t} from '@angular/platform-browser';
|
||||
|
||||
export var getDOM: typeof t.getDOM = r.getDOM;
|
|
@ -0,0 +1 @@
|
|||
../../facade/src
|
|
@ -1,3 +1,25 @@
|
|||
export * from '@angular/platform-browser/testing';
|
||||
import {DirectiveResolver, ViewResolver} from '@angular/compiler';
|
||||
import {MockDirectiveResolver, MockViewResolver, TestComponentBuilder, TestComponentRenderer} from '@angular/compiler/testing';
|
||||
import {TEST_BROWSER_APPLICATION_PROVIDERS, TEST_BROWSER_PLATFORM_PROVIDERS} from '@angular/platform-browser/testing';
|
||||
|
||||
console.log(`platform-browser-dynamic/testing is deprecated, use platform-browser/testing instead`);
|
||||
import {BROWSER_APP_COMPILER_PROVIDERS} from './index';
|
||||
import {DOMTestComponentRenderer} from './testing/dom_test_component_renderer';
|
||||
|
||||
/**
|
||||
* Default platform providers for testing.
|
||||
*/
|
||||
export const TEST_BROWSER_DYNAMIC_PLATFORM_PROVIDERS: Array<any /*Type | Provider | any[]*/> =
|
||||
[TEST_BROWSER_PLATFORM_PROVIDERS];
|
||||
|
||||
/**
|
||||
* Default application providers for testing.
|
||||
*/
|
||||
export const TEST_BROWSER_DYNAMIC_APPLICATION_PROVIDERS: Array<any /*Type | Provider | any[]*/> = [
|
||||
TEST_BROWSER_APPLICATION_PROVIDERS, BROWSER_APP_COMPILER_PROVIDERS,
|
||||
[
|
||||
{provide: DirectiveResolver, useClass: MockDirectiveResolver},
|
||||
{provide: ViewResolver, useClass: MockViewResolver},
|
||||
TestComponentBuilder,
|
||||
{provide: TestComponentRenderer, useClass: DOMTestComponentRenderer},
|
||||
]
|
||||
];
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
import {TestComponentRenderer} from '@angular/compiler/testing';
|
||||
import {Inject, Injectable} from '@angular/core';
|
||||
import {DOCUMENT} from '@angular/platform-browser';
|
||||
import {el} from '@angular/platform-browser/testing';
|
||||
|
||||
import {getDOM} from '../src/dom/dom_adapter';
|
||||
import {DOCUMENT} from '../src/dom/dom_tokens';
|
||||
import {getDOM} from '../platform_browser_private';
|
||||
|
||||
import {el} from './browser_util';
|
||||
|
||||
|
||||
/**
|
|
@ -1,4 +0,0 @@
|
|||
export * from '@angular/platform-browser/testing/e2e_util';
|
||||
|
||||
console.log(
|
||||
`platform-browser-dynamic/testing_e2e is deprecated, use platform-browser/testing_e2e instead`);
|
|
@ -12,10 +12,12 @@
|
|||
"moduleResolution": "node",
|
||||
"outDir": "../../../dist/packages-dist/platform-browser-dynamic/esm",
|
||||
"paths": {
|
||||
"@angular/common": ["../../../dist/packages-dist/common/"],
|
||||
"@angular/compiler": ["../../../dist/packages-dist/compiler/"],
|
||||
"@angular/core": ["../../../dist/packages-dist/core"],
|
||||
"@angular/core/testing": ["../../../dist/packages-dist/core/testing"],
|
||||
"@angular/common": ["../../../dist/packages-dist/common"],
|
||||
"@angular/common/testing": ["../../../dist/packages-dist/common/testing"],
|
||||
"@angular/compiler": ["../../../dist/packages-dist/compiler"],
|
||||
"@angular/compiler/testing": ["../../../dist/packages-dist/compiler/testing"],
|
||||
"@angular/core": ["../../../dist/packages-dist/core/"],
|
||||
"@angular/platform-browser": ["../../../dist/packages-dist/platform-browser"],
|
||||
"@angular/platform-browser/testing": ["../../../dist/packages-dist/platform-browser/testing"]
|
||||
},
|
||||
|
@ -27,9 +29,7 @@
|
|||
"files": [
|
||||
"index.ts",
|
||||
"testing.ts",
|
||||
"../../../node_modules/@types/hammerjs/index.d.ts",
|
||||
"../../../node_modules/@types/protractor/index.d.ts",
|
||||
"../../../node_modules/@types/jasmine/index.d.ts",
|
||||
"../../../node_modules/zone.js/dist/zone.js.d.ts"
|
||||
]
|
||||
}
|
||||
}
|
||||
|
|
|
@ -13,7 +13,9 @@
|
|||
"outDir": "../../../dist/packages-dist/platform-browser-dynamic/",
|
||||
"paths": {
|
||||
"@angular/core": ["../../../dist/packages-dist/core"],
|
||||
"@angular/core/testing": ["../../../dist/packages-dist/core/testing"],
|
||||
"@angular/common": ["../../../dist/packages-dist/common"],
|
||||
"@angular/common/testing": ["../../../dist/packages-dist/common/testing"],
|
||||
"@angular/compiler": ["../../../dist/packages-dist/compiler"],
|
||||
"@angular/compiler/testing": ["../../../dist/packages-dist/compiler/testing"],
|
||||
"@angular/platform-browser": ["../../../dist/packages-dist/platform-browser"],
|
||||
|
@ -28,9 +30,7 @@
|
|||
"files": [
|
||||
"index.ts",
|
||||
"testing.ts",
|
||||
"../../../node_modules/@types/hammerjs/index.d.ts",
|
||||
"../../../node_modules/@types/protractor/index.d.ts",
|
||||
"../../../node_modules/@types/jasmine/index.d.ts",
|
||||
"../../../node_modules/zone.js/dist/zone.js.d.ts"
|
||||
]
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2,22 +2,27 @@ import * as dom_adapter from './src/dom/dom_adapter';
|
|||
import * as dom_renderer from './src/dom/dom_renderer';
|
||||
import * as shared_styles_host from './src/dom/shared_styles_host';
|
||||
|
||||
export namespace __platform_browser_private__ {
|
||||
export type DomAdapter = dom_adapter.DomAdapter;
|
||||
export var DomAdapter = dom_adapter.DomAdapter;
|
||||
|
||||
export function getDOM(): DomAdapter {
|
||||
return dom_adapter.getDOM();
|
||||
export declare namespace __platform_browser_private_types__ {
|
||||
export type DomAdapter = dom_adapter.DomAdapter;
|
||||
export var DomAdapter: typeof dom_adapter.DomAdapter;
|
||||
export var getDOM: typeof dom_adapter.getDOM;
|
||||
export var setRootDomAdapter: typeof dom_adapter.setRootDomAdapter;
|
||||
export type DomRootRenderer = dom_renderer.DomRootRenderer;
|
||||
export var DomRootRenderer: typeof dom_renderer.DomRootRenderer;
|
||||
export type DomRootRenderer_ = dom_renderer.DomRootRenderer_;
|
||||
export var DomRootRenderer_: typeof dom_renderer.DomRootRenderer_;
|
||||
export type DomSharedStylesHost = shared_styles_host.DomSharedStylesHost;
|
||||
export var DomSharedStylesHost: typeof shared_styles_host.DomSharedStylesHost;
|
||||
export type SharedStylesHost = shared_styles_host.SharedStylesHost;
|
||||
export var SharedStylesHost: typeof shared_styles_host.SharedStylesHost;
|
||||
}
|
||||
|
||||
export var setRootDomAdapter = dom_adapter.setRootDomAdapter;
|
||||
|
||||
export type DomRootRenderer = dom_renderer.DomRootRenderer;
|
||||
export var DomRootRenderer = dom_renderer.DomRootRenderer;
|
||||
export type DomRootRenderer_ = dom_renderer.DomRootRenderer_;
|
||||
export var DomRootRenderer_ = dom_renderer.DomRootRenderer_;
|
||||
export type DomSharedStylesHost = shared_styles_host.DomSharedStylesHost;
|
||||
export var DomSharedStylesHost = shared_styles_host.DomSharedStylesHost;
|
||||
export type SharedStylesHost = shared_styles_host.SharedStylesHost;
|
||||
export var SharedStylesHost = shared_styles_host.SharedStylesHost;
|
||||
}
|
||||
export var __platform_browser_private__ = {
|
||||
DomAdapter: dom_adapter.DomAdapter,
|
||||
getDOM: dom_adapter.getDOM,
|
||||
setRootDomAdapter: dom_adapter.setRootDomAdapter,
|
||||
DomRootRenderer: dom_renderer.DomRootRenderer,
|
||||
DomRootRenderer_: dom_renderer.DomRootRenderer_,
|
||||
DomSharedStylesHost: shared_styles_host.DomSharedStylesHost,
|
||||
SharedStylesHost: shared_styles_host.SharedStylesHost
|
||||
};
|
||||
|
|
|
@ -7,7 +7,6 @@ export default {
|
|||
globals: {
|
||||
'@angular/core': 'ng.core',
|
||||
'@angular/common': 'ng.common',
|
||||
'@angular/compiler': 'ng.compiler',
|
||||
'rxjs/Subject': 'Rx',
|
||||
'rxjs/observable/PromiseObservable': 'Rx', // this is wrong, but this stuff has changed in rxjs b.6 so we need to fix it when we update.
|
||||
'rxjs/operator/toPromise': 'Rx.Observable.prototype',
|
||||
|
|
|
@ -1,8 +1,7 @@
|
|||
import {COMMON_DIRECTIVES, COMMON_PIPES, FORM_PROVIDERS, PlatformLocation} from '@angular/common';
|
||||
import {COMPILER_PROVIDERS, CompilerConfig, XHR} from '@angular/compiler';
|
||||
import {APPLICATION_COMMON_PROVIDERS, ComponentRef, ExceptionHandler, OpaqueToken, PLATFORM_COMMON_PROVIDERS, PLATFORM_INITIALIZER, PlatformRef, ReflectiveInjector, RootRenderer, Testability, Type, assertPlatform, coreLoadAndBootstrap, createPlatform, getPlatform} from '@angular/core';
|
||||
import {FORM_PROVIDERS, PlatformLocation} from '@angular/common';
|
||||
import {APPLICATION_COMMON_PROVIDERS, ExceptionHandler, OpaqueToken, PLATFORM_COMMON_PROVIDERS, PLATFORM_INITIALIZER, PlatformRef, ReflectiveInjector, RootRenderer, Testability, assertPlatform, createPlatform, getPlatform} from '@angular/core';
|
||||
|
||||
import {AnimationDriver, NoOpAnimationDriver, ReflectionCapabilities, SanitizationService, reflector, wtfInit} from '../core_private';
|
||||
import {AnimationDriver, NoOpAnimationDriver, SanitizationService, wtfInit} from '../core_private';
|
||||
import {WebAnimationsDriver} from '../src/dom/web_animations_driver';
|
||||
|
||||
import {BrowserDomAdapter} from './browser/browser_adapter';
|
||||
|
@ -17,13 +16,9 @@ import {EVENT_MANAGER_PLUGINS, EventManager} from './dom/events/event_manager';
|
|||
import {HAMMER_GESTURE_CONFIG, HammerGestureConfig, HammerGesturesPlugin} from './dom/events/hammer_gestures';
|
||||
import {KeyEventsPlugin} from './dom/events/key_events';
|
||||
import {DomSharedStylesHost, SharedStylesHost} from './dom/shared_styles_host';
|
||||
import {assertionsEnabled, isBlank, isPresent} from './facade/lang';
|
||||
import {isBlank} from './facade/lang';
|
||||
import {DomSanitizationService, DomSanitizationServiceImpl} from './security/dom_sanitization_service';
|
||||
import {CachedXHR} from './xhr/xhr_cache';
|
||||
import {XHRImpl} from './xhr/xhr_impl';
|
||||
|
||||
export const CACHED_TEMPLATE_PROVIDER: Array<any /*Type | Provider | any[]*/> =
|
||||
[{provide: XHR, useClass: CachedXHR}];
|
||||
|
||||
const BROWSER_PLATFORM_MARKER = new OpaqueToken('BrowserPlatformMarker');
|
||||
|
||||
|
@ -63,15 +58,6 @@ export const BROWSER_APP_PROVIDERS: Array<any /*Type | Provider | any[]*/> = [
|
|||
Testability, EventManager, ELEMENT_PROBE_PROVIDERS
|
||||
];
|
||||
|
||||
export const BROWSER_APP_COMPILER_PROVIDERS: Array<any /*Type | Provider | any[]*/> = [
|
||||
COMPILER_PROVIDERS,
|
||||
{
|
||||
provide: CompilerConfig,
|
||||
useValue:
|
||||
new CompilerConfig({platformDirectives: COMMON_DIRECTIVES, platformPipes: COMMON_PIPES})
|
||||
},
|
||||
{provide: XHR, useClass: XHRImpl},
|
||||
];
|
||||
|
||||
export function browserPlatform(): PlatformRef {
|
||||
if (isBlank(getPlatform())) {
|
||||
|
@ -80,86 +66,6 @@ export function browserPlatform(): PlatformRef {
|
|||
return assertPlatform(BROWSER_PLATFORM_MARKER);
|
||||
}
|
||||
|
||||
/**
|
||||
* Bootstrapping for Angular applications.
|
||||
*
|
||||
* You instantiate an Angular application by explicitly specifying a component to use
|
||||
* as the root component for your application via the `bootstrap()` method.
|
||||
*
|
||||
* ## Simple Example
|
||||
*
|
||||
* Assuming this `index.html`:
|
||||
*
|
||||
* ```html
|
||||
* <html>
|
||||
* <!-- load Angular script tags here. -->
|
||||
* <body>
|
||||
* <my-app>loading...</my-app>
|
||||
* </body>
|
||||
* </html>
|
||||
* ```
|
||||
*
|
||||
* An application is bootstrapped inside an existing browser DOM, typically `index.html`.
|
||||
* Unlike Angular 1, Angular 2 does not compile/process providers in `index.html`. This is
|
||||
* mainly for security reasons, as well as architectural changes in Angular 2. This means
|
||||
* that `index.html` can safely be processed using server-side technologies such as
|
||||
* providers. Bindings can thus use double-curly `{{ syntax }}` without collision from
|
||||
* Angular 2 component double-curly `{{ syntax }}`.
|
||||
*
|
||||
* We can use this script code:
|
||||
*
|
||||
* {@example core/ts/bootstrap/bootstrap.ts region='bootstrap'}
|
||||
*
|
||||
* When the app developer invokes `bootstrap()` with the root component `MyApp` as its
|
||||
* argument, Angular performs the following tasks:
|
||||
*
|
||||
* 1. It uses the component's `selector` property to locate the DOM element which needs
|
||||
* to be upgraded into the angular component.
|
||||
* 2. It creates a new child injector (from the platform injector). Optionally, you can
|
||||
* also override the injector configuration for an app by invoking `bootstrap` with the
|
||||
* `componentInjectableBindings` argument.
|
||||
* 3. It creates a new `Zone` and connects it to the angular application's change detection
|
||||
* domain instance.
|
||||
* 4. It creates an emulated or shadow DOM on the selected component's host element and loads the
|
||||
* template into it.
|
||||
* 5. It instantiates the specified component.
|
||||
* 6. Finally, Angular performs change detection to apply the initial data providers for the
|
||||
* application.
|
||||
*
|
||||
*
|
||||
* ## Bootstrapping Multiple Applications
|
||||
*
|
||||
* When working within a browser window, there are many singleton resources: cookies, title,
|
||||
* location, and others. Angular services that represent these resources must likewise be
|
||||
* shared across all Angular applications that occupy the same browser window. For this
|
||||
* reason, Angular creates exactly one global platform object which stores all shared
|
||||
* services, and each angular application injector has the platform injector as its parent.
|
||||
*
|
||||
* Each application has its own private injector as well. When there are multiple
|
||||
* applications on a page, Angular treats each application injector's services as private
|
||||
* to that application.
|
||||
*
|
||||
* ## API
|
||||
*
|
||||
* - `appComponentType`: The root component which should act as the application. This is
|
||||
* a reference to a `Type` which is annotated with `@Component(...)`.
|
||||
* - `customProviders`: An additional set of providers that can be added to the
|
||||
* app injector to override default injection behavior.
|
||||
*
|
||||
* Returns a `Promise` of {@link ComponentRef}.
|
||||
*/
|
||||
export function bootstrap(
|
||||
appComponentType: Type,
|
||||
customProviders?: Array<any /*Type | Provider | any[]*/>): Promise<ComponentRef<any>> {
|
||||
reflector.reflectionCapabilities = new ReflectionCapabilities();
|
||||
let providers = [
|
||||
BROWSER_APP_PROVIDERS, BROWSER_APP_COMPILER_PROVIDERS,
|
||||
isPresent(customProviders) ? customProviders : []
|
||||
];
|
||||
var appInjector = ReflectiveInjector.resolveAndCreate(providers, browserPlatform().injector);
|
||||
return coreLoadAndBootstrap(appComponentType, appInjector);
|
||||
}
|
||||
|
||||
function initDomAdapter() {
|
||||
BrowserDomAdapter.makeCurrent();
|
||||
wtfInit();
|
||||
|
|
|
@ -1,9 +1,8 @@
|
|||
import {COMMON_DIRECTIVES, COMMON_PIPES, FORM_PROVIDERS} from '@angular/common';
|
||||
import {COMPILER_PROVIDERS, CompilerConfig, XHR} from '@angular/compiler';
|
||||
import {APPLICATION_COMMON_PROVIDERS, APP_INITIALIZER, ComponentRef, ExceptionHandler, NgZone, OpaqueToken, PLATFORM_COMMON_PROVIDERS, PlatformRef, ReflectiveInjector, RootRenderer, Type, assertPlatform, coreLoadAndBootstrap, createPlatform, getPlatform} from '@angular/core';
|
||||
import {FORM_PROVIDERS} from '@angular/common';
|
||||
import {APPLICATION_COMMON_PROVIDERS, APP_INITIALIZER, ExceptionHandler, NgZone, OpaqueToken, PLATFORM_COMMON_PROVIDERS, PlatformRef, ReflectiveInjector, RootRenderer, assertPlatform, createPlatform, getPlatform} from '@angular/core';
|
||||
|
||||
import {BROWSER_SANITIZATION_PROVIDERS} from './browser';
|
||||
import {assertionsEnabled, isBlank, isPresent, print} from './facade/lang';
|
||||
import {isBlank, print} from './facade/lang';
|
||||
import {ON_WEB_WORKER} from './web_workers/shared/api';
|
||||
import {ClientMessageBrokerFactory, ClientMessageBrokerFactory_} from './web_workers/shared/client_message_broker';
|
||||
import {MessageBus} from './web_workers/shared/message_bus';
|
||||
|
@ -13,7 +12,6 @@ import {Serializer} from './web_workers/shared/serializer';
|
|||
import {ServiceMessageBrokerFactory, ServiceMessageBrokerFactory_} from './web_workers/shared/service_message_broker';
|
||||
import {WebWorkerRootRenderer} from './web_workers/worker/renderer';
|
||||
import {WorkerDomAdapter} from './web_workers/worker/worker_adapter';
|
||||
import {XHRImpl} from './xhr/xhr_impl';
|
||||
|
||||
class PrintLogger {
|
||||
log = print;
|
||||
|
@ -45,29 +43,6 @@ export function workerAppPlatform(): PlatformRef {
|
|||
return assertPlatform(WORKER_APP_PLATFORM_MARKER);
|
||||
}
|
||||
|
||||
const WORKER_APP_COMPILER_PROVIDERS: Array<any /*Type | Provider | any[]*/> = [
|
||||
COMPILER_PROVIDERS,
|
||||
{
|
||||
provide: CompilerConfig,
|
||||
useValue:
|
||||
new CompilerConfig({platformDirectives: COMMON_DIRECTIVES, platformPipes: COMMON_PIPES})
|
||||
},
|
||||
{provide: XHR, useClass: XHRImpl},
|
||||
];
|
||||
|
||||
export function bootstrapApp(
|
||||
appComponentType: Type,
|
||||
customProviders?: Array<any /*Type | Provider | any[]*/>): Promise<ComponentRef<any>> {
|
||||
var appInjector = ReflectiveInjector.resolveAndCreate(
|
||||
[
|
||||
WORKER_APP_APPLICATION_PROVIDERS, WORKER_APP_COMPILER_PROVIDERS,
|
||||
isPresent(customProviders) ? customProviders : []
|
||||
],
|
||||
workerAppPlatform().injector);
|
||||
return coreLoadAndBootstrap(appComponentType, appInjector);
|
||||
}
|
||||
|
||||
|
||||
function _exceptionHandler(): ExceptionHandler {
|
||||
return new ExceptionHandler(new PrintLogger());
|
||||
}
|
||||
|
@ -89,4 +64,4 @@ function createMessageBus(zone: NgZone): MessageBus {
|
|||
|
||||
function setupWebWorker(): void {
|
||||
WorkerDomAdapter.makeCurrent();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2,7 +2,7 @@ import {APPLICATION_COMMON_PROVIDERS, APP_INITIALIZER, ApplicationRef, Exception
|
|||
|
||||
import {AnimationDriver, NoOpAnimationDriver, wtfInit} from '../core_private';
|
||||
|
||||
import {BROWSER_APP_COMPILER_PROVIDERS, BROWSER_SANITIZATION_PROVIDERS} from './browser';
|
||||
import {BROWSER_SANITIZATION_PROVIDERS} from './browser';
|
||||
import {BrowserDomAdapter} from './browser/browser_adapter';
|
||||
import {BrowserGetTestability} from './browser/testability';
|
||||
import {getDOM} from './dom/dom_adapter';
|
||||
|
@ -13,9 +13,8 @@ import {EVENT_MANAGER_PLUGINS, EventManager} from './dom/events/event_manager';
|
|||
import {HAMMER_GESTURE_CONFIG, HammerGestureConfig, HammerGesturesPlugin} from './dom/events/hammer_gestures';
|
||||
import {KeyEventsPlugin} from './dom/events/key_events';
|
||||
import {DomSharedStylesHost, SharedStylesHost} from './dom/shared_styles_host';
|
||||
import {PromiseWrapper} from './facade/async';
|
||||
import {BaseException} from './facade/exceptions';
|
||||
import {isBlank, isPresent} from './facade/lang';
|
||||
import {isBlank} from './facade/lang';
|
||||
import {ON_WEB_WORKER} from './web_workers/shared/api';
|
||||
import {ClientMessageBrokerFactory, ClientMessageBrokerFactory_} from './web_workers/shared/client_message_broker';
|
||||
import {MessageBus} from './web_workers/shared/message_bus';
|
||||
|
@ -103,22 +102,6 @@ export function initializeGenericWorkerRenderer(injector: Injector) {
|
|||
zone.runGuarded(() => { services.forEach((svc: any /** TODO #9100 */) => { svc.start(); }); });
|
||||
}
|
||||
|
||||
export function bootstrapRender(
|
||||
workerScriptUri: string,
|
||||
customProviders?: Array<any /*Type | Provider | any[]*/>): Promise<ApplicationRef> {
|
||||
var app = ReflectiveInjector.resolveAndCreate(
|
||||
[
|
||||
WORKER_RENDER_APPLICATION_PROVIDERS, BROWSER_APP_COMPILER_PROVIDERS,
|
||||
{provide: WORKER_SCRIPT, useValue: workerScriptUri},
|
||||
isPresent(customProviders) ? customProviders : []
|
||||
],
|
||||
workerRenderPlatform().injector);
|
||||
// Return a promise so that we keep the same semantics as Dart,
|
||||
// and we might want to wait for the app side to come up
|
||||
// in the future...
|
||||
return PromiseWrapper.resolve(app.get(ApplicationRef));
|
||||
}
|
||||
|
||||
function messageBusFactory(instance: WebWorkerInstance): MessageBus {
|
||||
return instance.bus;
|
||||
}
|
||||
|
|
|
@ -5,7 +5,8 @@ import {ComponentRef} from '@angular/core/src/linker/component_factory';
|
|||
import {Testability, TestabilityRegistry} from '@angular/core/src/testability/testability';
|
||||
import {Log} from '@angular/core/testing';
|
||||
import {AsyncTestCompleter, afterEach, beforeEach, describe, expect, inject, it} from '@angular/core/testing/testing_internal';
|
||||
import {BROWSER_APP_COMPILER_PROVIDERS, BROWSER_APP_PROVIDERS, BROWSER_PLATFORM_PROVIDERS, bootstrap} from '@angular/platform-browser';
|
||||
import {BROWSER_APP_PROVIDERS, BROWSER_PLATFORM_PROVIDERS} from '@angular/platform-browser';
|
||||
import {BROWSER_APP_COMPILER_PROVIDERS, bootstrap} from '@angular/platform-browser-dynamic';
|
||||
import {getDOM} from '@angular/platform-browser/src/dom/dom_adapter';
|
||||
import {DOCUMENT} from '@angular/platform-browser/src/dom/dom_tokens';
|
||||
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
export * from './testing/browser_util';
|
||||
export * from './testing/browser_static';
|
||||
export * from './testing/matchers';
|
||||
export * from './testing/browser';
|
||||
export * from './testing/dom_test_component_renderer';
|
||||
|
|
|
@ -1,30 +1,50 @@
|
|||
import {DirectiveResolver, ViewResolver} from '@angular/compiler';
|
||||
import {MockDirectiveResolver, MockViewResolver, TestComponentBuilder, TestComponentRenderer} from '@angular/compiler/testing';
|
||||
import {LocationStrategy} from '@angular/common';
|
||||
import {MockLocationStrategy} from '@angular/common/testing';
|
||||
import {APP_ID, NgZone, PLATFORM_COMMON_PROVIDERS, PLATFORM_INITIALIZER} from '@angular/core';
|
||||
import {Log} from '@angular/core/testing';
|
||||
|
||||
import {BROWSER_APP_COMPILER_PROVIDERS, BROWSER_APP_PROVIDERS} from '../index';
|
||||
import {AnimationDriver, NoOpAnimationDriver} from '../core_private';
|
||||
import {BROWSER_APP_PROVIDERS} from '../src/browser';
|
||||
import {BrowserDomAdapter} from '../src/browser/browser_adapter';
|
||||
import {ELEMENT_PROBE_PROVIDERS} from '../src/dom/debug/ng_probe';
|
||||
|
||||
import {ADDITIONAL_TEST_BROWSER_STATIC_PROVIDERS, TEST_BROWSER_STATIC_PLATFORM_PROVIDERS} from './browser_static';
|
||||
import {DOMTestComponentRenderer} from './dom_test_component_renderer';
|
||||
import {BrowserDetection} from './browser_util';
|
||||
|
||||
|
||||
/**
|
||||
* Default platform providers for testing without a compiler.
|
||||
*/
|
||||
const TEST_BROWSER_STATIC_PLATFORM_PROVIDERS: Array<any /*Type | Provider | any[]*/> = [
|
||||
PLATFORM_COMMON_PROVIDERS,
|
||||
{provide: PLATFORM_INITIALIZER, useValue: initBrowserTests, multi: true}
|
||||
];
|
||||
|
||||
const ADDITIONAL_TEST_BROWSER_STATIC_PROVIDERS: Array<any /*Type | Provider | any[]*/> = [
|
||||
{provide: APP_ID, useValue: 'a'}, ELEMENT_PROBE_PROVIDERS, Log,
|
||||
{provide: NgZone, useFactory: createNgZone},
|
||||
{provide: LocationStrategy, useClass: MockLocationStrategy},
|
||||
{provide: AnimationDriver, useClass: NoOpAnimationDriver}
|
||||
];
|
||||
|
||||
|
||||
function initBrowserTests() {
|
||||
BrowserDomAdapter.makeCurrent();
|
||||
BrowserDetection.setup();
|
||||
}
|
||||
|
||||
function createNgZone(): NgZone {
|
||||
return new NgZone({enableLongStackTrace: true});
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Default platform providers for testing.
|
||||
*/
|
||||
export const TEST_BROWSER_PLATFORM_PROVIDERS: Array<any /*Type | Provider | any[]*/> =
|
||||
[TEST_BROWSER_STATIC_PLATFORM_PROVIDERS];
|
||||
|
||||
|
||||
export const ADDITIONAL_TEST_BROWSER_PROVIDERS = [
|
||||
{provide: DirectiveResolver, useClass: MockDirectiveResolver},
|
||||
{provide: ViewResolver, useClass: MockViewResolver},
|
||||
TestComponentBuilder,
|
||||
{provide: TestComponentRenderer, useClass: DOMTestComponentRenderer},
|
||||
];
|
||||
TEST_BROWSER_STATIC_PLATFORM_PROVIDERS;
|
||||
|
||||
/**
|
||||
* Default application providers for testing.
|
||||
* Default application providers for testing without a compiler.
|
||||
*/
|
||||
export const TEST_BROWSER_APPLICATION_PROVIDERS: Array<any /*Type | Provider | any[]*/> = [
|
||||
BROWSER_APP_PROVIDERS, BROWSER_APP_COMPILER_PROVIDERS, ADDITIONAL_TEST_BROWSER_STATIC_PROVIDERS,
|
||||
ADDITIONAL_TEST_BROWSER_PROVIDERS
|
||||
];
|
||||
export const TEST_BROWSER_APPLICATION_PROVIDERS: Array<any /*Type | Provider | any[]*/> =
|
||||
[BROWSER_APP_PROVIDERS, ADDITIONAL_TEST_BROWSER_STATIC_PROVIDERS];
|
||||
|
|
|
@ -1,42 +0,0 @@
|
|||
import {LocationStrategy} from '@angular/common';
|
||||
import {MockLocationStrategy} from '@angular/common/testing';
|
||||
import {APP_ID, NgZone, PLATFORM_COMMON_PROVIDERS, PLATFORM_INITIALIZER} from '@angular/core';
|
||||
import {Log} from '@angular/core/testing';
|
||||
|
||||
import {AnimationDriver, NoOpAnimationDriver} from '../core_private';
|
||||
import {BROWSER_APP_PROVIDERS} from '../src/browser';
|
||||
import {BrowserDomAdapter} from '../src/browser/browser_adapter';
|
||||
import {ELEMENT_PROBE_PROVIDERS} from '../src/dom/debug/ng_probe';
|
||||
|
||||
import {BrowserDetection} from './browser_util';
|
||||
|
||||
|
||||
/**
|
||||
* Default platform providers for testing without a compiler.
|
||||
*/
|
||||
export const TEST_BROWSER_STATIC_PLATFORM_PROVIDERS: Array<any /*Type | Provider | any[]*/> = [
|
||||
PLATFORM_COMMON_PROVIDERS,
|
||||
{provide: PLATFORM_INITIALIZER, useValue: initBrowserTests, multi: true}
|
||||
];
|
||||
|
||||
export const ADDITIONAL_TEST_BROWSER_STATIC_PROVIDERS: Array<any /*Type | Provider | any[]*/> = [
|
||||
{provide: APP_ID, useValue: 'a'}, ELEMENT_PROBE_PROVIDERS, Log,
|
||||
{provide: NgZone, useFactory: createNgZone},
|
||||
{provide: LocationStrategy, useClass: MockLocationStrategy},
|
||||
{provide: AnimationDriver, useClass: NoOpAnimationDriver}
|
||||
];
|
||||
|
||||
/**
|
||||
* Default application providers for testing without a compiler.
|
||||
*/
|
||||
export const TEST_BROWSER_STATIC_APPLICATION_PROVIDERS: Array<any /*Type | Provider | any[]*/> =
|
||||
[BROWSER_APP_PROVIDERS, ADDITIONAL_TEST_BROWSER_STATIC_PROVIDERS];
|
||||
|
||||
function initBrowserTests() {
|
||||
BrowserDomAdapter.makeCurrent();
|
||||
BrowserDetection.setup();
|
||||
}
|
||||
|
||||
function createNgZone(): NgZone {
|
||||
return new NgZone({enableLongStackTrace: true});
|
||||
}
|
|
@ -16,8 +16,7 @@
|
|||
"@angular/core/testing": ["../../../dist/packages-dist/core/testing"],
|
||||
"@angular/common": ["../../../dist/packages-dist/common"],
|
||||
"@angular/common/testing": ["../../../dist/packages-dist/common/testing"],
|
||||
"@angular/compiler": ["../../../dist/packages-dist/compiler"],
|
||||
"@angular/compiler/testing": ["../../../dist/packages-dist/compiler/testing"],
|
||||
|
||||
// workaround for https://github.com/Microsoft/TypeScript/issues/8723
|
||||
// we can get rid of this once we update to typescript 1.9.0-dev.20160525-1.0 or newer
|
||||
"selenium-webdriver": ["../../../node_modules/@types/selenium-webdriver/index.d.ts"]
|
||||
|
@ -32,8 +31,8 @@
|
|||
"testing.ts",
|
||||
"testing_e2e.ts",
|
||||
"../../../node_modules/@types/hammerjs/index.d.ts",
|
||||
"../../../node_modules/@types/protractor/index.d.ts",
|
||||
"../../../node_modules/@types/jasmine/index.d.ts",
|
||||
"../../../node_modules/@types/protractor/index.d.ts",
|
||||
"../../../node_modules/zone.js/dist/zone.js.d.ts"
|
||||
]
|
||||
}
|
||||
|
|
|
@ -16,8 +16,7 @@
|
|||
"@angular/core/testing": ["../../../dist/packages-dist/core/testing"],
|
||||
"@angular/common": ["../../../dist/packages-dist/common"],
|
||||
"@angular/common/testing": ["../../../dist/packages-dist/common/testing"],
|
||||
"@angular/compiler": ["../../../dist/packages-dist/compiler"],
|
||||
"@angular/compiler/testing": ["../../../dist/packages-dist/compiler/testing"],
|
||||
|
||||
// workaround for https://github.com/Microsoft/TypeScript/issues/8723
|
||||
// we can get rid of this once we update to typescript 1.9.0-dev.20160525-1.0 or newer
|
||||
"selenium-webdriver": ["../../../node_modules/@types/selenium-webdriver/index.d.ts"]
|
||||
|
@ -33,8 +32,8 @@
|
|||
"testing.ts",
|
||||
"testing_e2e.ts",
|
||||
"../../../node_modules/@types/hammerjs/index.d.ts",
|
||||
"../../../node_modules/@types/protractor/index.d.ts",
|
||||
"../../../node_modules/@types/jasmine/index.d.ts",
|
||||
"../../../node_modules/@types/protractor/index.d.ts",
|
||||
"../../../node_modules/zone.js/dist/zone.js.d.ts"
|
||||
]
|
||||
}
|
||||
|
|
|
@ -1,14 +1,14 @@
|
|||
import {__platform_browser_private__ as _} from '@angular/platform-browser';
|
||||
import {__platform_browser_private__ as r, __platform_browser_private_types__ as t} from '@angular/platform-browser';
|
||||
|
||||
export type DomAdapter = typeof _.DomAdapter;
|
||||
export var DomAdapter: typeof _.DomAdapter = _.DomAdapter;
|
||||
export var setRootDomAdapter: typeof _.setRootDomAdapter = _.setRootDomAdapter;
|
||||
export var getDOM: typeof _.getDOM = _.getDOM;
|
||||
export type DomRootRenderer = typeof _.DomRootRenderer;
|
||||
export var DomRootRenderer: typeof _.DomRootRenderer = _.DomRootRenderer;
|
||||
export type DomRootRenderer_ = typeof _.DomRootRenderer_;
|
||||
export var DomRootRenderer_: typeof _.DomRootRenderer_ = _.DomRootRenderer_;
|
||||
export type DomSharedStylesHost = typeof _.DomSharedStylesHost;
|
||||
export var DomSharedStylesHost: typeof _.DomSharedStylesHost = _.DomSharedStylesHost;
|
||||
export type SharedStylesHost = typeof _.SharedStylesHost;
|
||||
export var SharedStylesHost: typeof _.SharedStylesHost = _.SharedStylesHost;
|
||||
export type DomAdapter = typeof t.DomAdapter;
|
||||
export var DomAdapter: typeof t.DomAdapter = r.DomAdapter;
|
||||
export var setRootDomAdapter: typeof t.setRootDomAdapter = r.setRootDomAdapter;
|
||||
export var getDOM: typeof t.getDOM = r.getDOM;
|
||||
export type DomRootRenderer = typeof t.DomRootRenderer;
|
||||
export var DomRootRenderer: typeof t.DomRootRenderer = r.DomRootRenderer;
|
||||
export type DomRootRenderer_ = typeof t.DomRootRenderer_;
|
||||
export var DomRootRenderer_: typeof t.DomRootRenderer_ = r.DomRootRenderer_;
|
||||
export type DomSharedStylesHost = typeof t.DomSharedStylesHost;
|
||||
export var DomSharedStylesHost: typeof t.DomSharedStylesHost = r.DomSharedStylesHost;
|
||||
export type SharedStylesHost = typeof t.SharedStylesHost;
|
||||
export var SharedStylesHost: typeof t.SharedStylesHost = r.SharedStylesHost;
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
import {PlatformLocation} from '@angular/common';
|
||||
import {ComponentRef, OpaqueToken, PLATFORM_COMMON_PROVIDERS, PLATFORM_INITIALIZER, PlatformRef, ReflectiveInjector, Type, assertPlatform, coreLoadAndBootstrap, createPlatform, getPlatform} from '@angular/core';
|
||||
import {BROWSER_APP_COMPILER_PROVIDERS, BROWSER_APP_PROVIDERS, BrowserPlatformLocation} from '@angular/platform-browser';
|
||||
import {BROWSER_APP_PROVIDERS, BrowserPlatformLocation} from '@angular/platform-browser';
|
||||
import {BROWSER_APP_COMPILER_PROVIDERS} from '@angular/platform-browser-dynamic';
|
||||
|
||||
import {ReflectionCapabilities, reflector, wtfInit} from '../core_private';
|
||||
|
||||
|
|
|
@ -2,7 +2,8 @@ import {MockLocationStrategy} from '@angular/common/testing';
|
|||
import {COMPILER_PROVIDERS, DirectiveResolver, ViewResolver, XHR} from '@angular/compiler';
|
||||
import {MockDirectiveResolver, MockViewResolver, TestComponentBuilder, TestComponentRenderer} from '@angular/compiler/testing';
|
||||
import {APPLICATION_COMMON_PROVIDERS, APP_ID, NgZone, PLATFORM_COMMON_PROVIDERS, PLATFORM_INITIALIZER, RootRenderer} from '@angular/core';
|
||||
import {BrowserDetection, DOMTestComponentRenderer} from '@angular/platform-browser/testing';
|
||||
import {DOMTestComponentRenderer} from '@angular/platform-browser-dynamic/testing';
|
||||
import {BrowserDetection} from '@angular/platform-browser/testing';
|
||||
|
||||
import {AnimationDriver, NoOpAnimationDriver} from '../core_private';
|
||||
import {Parse5DomAdapter} from '../src/parse5_adapter';
|
||||
|
|
|
@ -19,7 +19,9 @@
|
|||
"@angular/compiler": ["../../../dist/packages-dist/compiler/"],
|
||||
"@angular/compiler/testing": ["../../../dist/packages-dist/compiler/testing"],
|
||||
"@angular/platform-browser": ["../../../dist/packages-dist/platform-browser/"],
|
||||
"@angular/platform-browser/testing": ["../../../dist/packages-dist/platform-browser/testing"]
|
||||
"@angular/platform-browser/testing": ["../../../dist/packages-dist/platform-browser/testing"],
|
||||
"@angular/platform-browser-dynamic": ["../../../dist/packages-dist/platform-browser-dynamic"],
|
||||
"@angular/platform-browser-dynamic/testing": ["../../../dist/packages-dist/platform-browser-dynamic/testing"]
|
||||
},
|
||||
"rootDir": ".",
|
||||
"sourceMap": true,
|
||||
|
|
|
@ -19,7 +19,9 @@
|
|||
"@angular/compiler": ["../../../dist/packages-dist/compiler/"],
|
||||
"@angular/compiler/testing": ["../../../dist/packages-dist/compiler/testing"],
|
||||
"@angular/platform-browser": ["../../../dist/packages-dist/platform-browser/"],
|
||||
"@angular/platform-browser/testing": ["../../../dist/packages-dist/platform-browser/testing"]
|
||||
"@angular/platform-browser/testing": ["../../../dist/packages-dist/platform-browser/testing"],
|
||||
"@angular/platform-browser-dynamic": ["../../../dist/packages-dist/platform-browser-dynamic"],
|
||||
"@angular/platform-browser-dynamic/testing": ["../../../dist/packages-dist/platform-browser-dynamic/testing"]
|
||||
},
|
||||
"rootDir": ".",
|
||||
"sourceMap": true,
|
||||
|
|
|
@ -2,16 +2,15 @@ import {beforeEach, beforeEachProviders, ddescribe, describe, expect, iit, injec
|
|||
import {AsyncTestCompleter} from '@angular/core/testing/testing_internal';
|
||||
import {TestComponentBuilder} from '@angular/compiler/testing';
|
||||
|
||||
import {bootstrap} from '@angular/platform-browser';
|
||||
import {bootstrap} from '@angular/platform-browser-dynamic';
|
||||
import {APP_BASE_HREF, LocationStrategy} from '@angular/common';
|
||||
import {Component, Directive} from '@angular/core/src/metadata';
|
||||
import {Component} from '@angular/core/src/metadata';
|
||||
import {getDOM} from '@angular/platform-browser/src/dom/dom_adapter';
|
||||
import {Console} from '@angular/core/src/console';
|
||||
import {provide} from '@angular/core';
|
||||
import {DOCUMENT} from '@angular/platform-browser/src/dom/dom_tokens';
|
||||
import {RouteConfig, Route, Redirect, AuxRoute} from '../../src/route_config/route_config_decorator';
|
||||
import {RouteConfig, Route, AuxRoute} from '../../src/route_config/route_config_decorator';
|
||||
import {PromiseWrapper} from '../../src/facade/async';
|
||||
import {BaseException, WrappedException} from '../../src/facade/exceptions';
|
||||
import {BaseException} from '../../src/facade/exceptions';
|
||||
import {ROUTER_PROVIDERS, ROUTER_PRIMARY_COMPONENT, RouteParams, Router, ROUTER_DIRECTIVES} from '@angular/router-deprecated';
|
||||
|
||||
import {MockLocationStrategy} from '@angular/common/testing';
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import {beforeEach, ddescribe, describe, expect, iit, inject, it, xdescribe, xit,} from '@angular/core/testing/testing_internal';
|
||||
|
||||
import {bootstrap} from '@angular/platform-browser';
|
||||
import {bootstrap} from '@angular/platform-browser-dynamic';
|
||||
import {APP_BASE_HREF, LocationStrategy} from '@angular/common';
|
||||
import {Component, Directive} from '@angular/core/src/metadata';
|
||||
import {getDOM} from '@angular/platform-browser/src/dom/dom_adapter';
|
||||
|
|
|
@ -9,6 +9,7 @@ export default {
|
|||
'@angular/common': 'ng.common',
|
||||
'@angular/compiler': 'ng.compiler',
|
||||
'@angular/platform-browser': 'ng.platformBrowser',
|
||||
'@angular/platform-browser-dynamic': 'ng.platformBrowser.dynamic',
|
||||
'rxjs/Subject': 'Rx',
|
||||
'rxjs/observable/PromiseObservable': 'Rx', // this is wrong, but this stuff has changed in rxjs b.6 so we need to fix it when we update.
|
||||
'rxjs/operator/toPromise': 'Rx.Observable.prototype',
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
import {ApplicationRef, ComponentFactory, ComponentResolver, Injector, NgZone, PlatformRef, Provider, ReflectiveInjector, Testability, Type, provide} from '@angular/core';
|
||||
import {BROWSER_APP_COMPILER_PROVIDERS, BROWSER_APP_PROVIDERS, browserPlatform} from '@angular/platform-browser';
|
||||
import {BROWSER_APP_PROVIDERS, browserPlatform} from '@angular/platform-browser';
|
||||
import {BROWSER_APP_COMPILER_PROVIDERS} from '@angular/platform-browser-dynamic';
|
||||
|
||||
import * as angular from './angular_js';
|
||||
import {NG1_COMPILE, NG1_INJECTOR, NG1_PARSE, NG1_ROOT_SCOPE, NG1_TESTABILITY, NG2_COMPILER, NG2_COMPONENT_FACTORY_REF_MAP, NG2_INJECTOR, NG2_ZONE, REQUIRE_INJECTOR} from './constants';
|
||||
|
|
|
@ -15,7 +15,8 @@
|
|||
"@angular/core": ["../../../dist/packages-dist/core"],
|
||||
"@angular/common": ["../../../dist/packages-dist/common"],
|
||||
"@angular/compiler": ["../../../dist/packages-dist/compiler"],
|
||||
"@angular/platform-browser": ["../../../dist/packages-dist/platform-browser"]
|
||||
"@angular/platform-browser": ["../../../dist/packages-dist/platform-browser"],
|
||||
"@angular/platform-browser-dynamic": ["../../../dist/packages-dist/platform-browser-dynamic"]
|
||||
},
|
||||
"rootDir": ".",
|
||||
"sourceMap": true,
|
||||
|
|
|
@ -15,7 +15,8 @@
|
|||
"@angular/core": ["../../../dist/packages-dist/core"],
|
||||
"@angular/common": ["../../../dist/packages-dist/common"],
|
||||
"@angular/compiler": ["../../../dist/packages-dist/compiler"],
|
||||
"@angular/platform-browser": ["../../../dist/packages-dist/platform-browser"]
|
||||
"@angular/platform-browser": ["../../../dist/packages-dist/platform-browser"],
|
||||
"@angular/platform-browser-dynamic": ["../../../dist/packages-dist/platform-browser-dynamic"]
|
||||
},
|
||||
"rootDir": ".",
|
||||
"sourceMap": true,
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import {InboxApp} from './app/inbox-app';
|
||||
import {bootstrap} from '@angular/platform-browser';
|
||||
import {bootstrap} from '@angular/platform-browser-dynamic';
|
||||
import {HashLocationStrategy, LocationStrategy} from '@angular/common';
|
||||
import {ROUTER_PROVIDERS} from '@angular/router-deprecated';
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import {AnimateApp} from './app/animate-app';
|
||||
import {bootstrap} from '@angular/platform-browser';
|
||||
import {bootstrap} from '@angular/platform-browser-dynamic';
|
||||
|
||||
export function main() {
|
||||
bootstrap(AnimateApp);
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import {bootstrap} from '@angular/platform-browser';
|
||||
import {bootstrap} from '@angular/platform-browser-dynamic';
|
||||
import {Component} from '@angular/core';
|
||||
import {NgIf} from '@angular/common';
|
||||
import {TimerWrapper} from '@angular/core/src/facade/async';
|
||||
|
|
|
@ -22,6 +22,7 @@ declare var System: any;
|
|||
'@angular/common': '/packages-dist/common/bundles/common.umd.js',
|
||||
'@angular/compiler': '/packages-dist/compiler/bundles/compiler.umd.js',
|
||||
'@angular/platform-browser': '/packages-dist/platform-browser/bundles/platform-browser.umd.js',
|
||||
'@angular/platform-browser-dynamic': '/packages-dist/platform-browser-dynamic/bundles/platform-browser-dynamic.umd.js',
|
||||
'@angular/http': '/packages-dist/http/bundles/http.umd.js',
|
||||
'@angular/upgrade': '/packages-dist/upgrade/bundles/upgrade.umd.js',
|
||||
'@angular/router': '/packages-dist/router/bundles/router.umd.js',
|
||||
|
@ -49,6 +50,7 @@ declare var System: any;
|
|||
'@angular/compiler': {main: 'index.js', defaultExtension: 'js'},
|
||||
'@angular/common': {main: 'index.js', defaultExtension: 'js'},
|
||||
'@angular/platform-browser': {main: 'index.js', defaultExtension: 'js'},
|
||||
'@angular/platform-browser-dynamic': {main: 'index.js', defaultExtension: 'js'},
|
||||
'@angular/router': {main: 'index.js', defaultExtension: 'js'},
|
||||
// 'rxjs': {
|
||||
// defaultExtension: 'js'
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import {bootstrap} from '@angular/platform-browser';
|
||||
import {bootstrap} from '@angular/platform-browser-dynamic';
|
||||
import {Component} from '@angular/core';
|
||||
|
||||
@Component({selector: 'gestures-app', templateUrl: 'template.html'})
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import {Component} from '@angular/core';
|
||||
import {bootstrap} from '@angular/platform-browser';
|
||||
import {bootstrap} from '@angular/platform-browser-dynamic';
|
||||
import {RouteConfig, Route, ROUTER_PROVIDERS, ROUTER_DIRECTIVES} from '@angular/router-deprecated';
|
||||
import {HashLocationStrategy, LocationStrategy} from '@angular/common';
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import {bootstrap} from '@angular/platform-browser';
|
||||
import {bootstrap} from '@angular/platform-browser-dynamic';
|
||||
import {Renderer, ElementRef, Component, Directive, Injectable} from '@angular/core';
|
||||
|
||||
export function main() {
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import {bootstrap} from '@angular/platform-browser';
|
||||
import {bootstrap} from '@angular/platform-browser-dynamic';
|
||||
import {HTTP_PROVIDERS} from '@angular/http';
|
||||
import {HttpCmp} from './app/http_comp';
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import {bootstrap} from '@angular/platform-browser';
|
||||
import {bootstrap} from '@angular/platform-browser-dynamic';
|
||||
import {JSONP_PROVIDERS} from '@angular/http';
|
||||
import {JsonpCmp} from './app/jsonp_comp';
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import {bootstrap} from '@angular/platform-browser';
|
||||
import {bootstrap} from '@angular/platform-browser-dynamic';
|
||||
import {Component} from '@angular/core';
|
||||
import {KeyEventsPlugin} from '@angular/platform-browser';
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import {bootstrap} from '@angular/platform-browser';
|
||||
import {bootstrap} from '@angular/platform-browser-dynamic';
|
||||
import {
|
||||
FORM_DIRECTIVES,
|
||||
ControlGroup,
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import {bootstrap} from '@angular/platform-browser';
|
||||
import {bootstrap} from '@angular/platform-browser-dynamic';
|
||||
import {
|
||||
Component,
|
||||
EventEmitter,
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import {bootstrap} from '@angular/platform-browser';
|
||||
import {bootstrap} from '@angular/platform-browser-dynamic';
|
||||
import {Component, Injectable} from '@angular/core';
|
||||
import {NgIf, NgFor, FORM_DIRECTIVES} from '@angular/common';
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import {bootstrap} from '@angular/platform-browser';
|
||||
import {bootstrap} from '@angular/platform-browser-dynamic';
|
||||
import {Component} from '@angular/core';
|
||||
import {MyCmp} from './app/my_cmp';
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import {InboxApp} from './app/inbox-app';
|
||||
import {bootstrap} from '@angular/platform-browser';
|
||||
import {bootstrap} from '@angular/platform-browser-dynamic';
|
||||
import {HashLocationStrategy, LocationStrategy} from '@angular/common';
|
||||
import {ROUTER_PROVIDERS} from '@angular/router-deprecated';
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import {BaseException} from '@angular/core/src/facade/exceptions';
|
||||
import {bootstrap} from '@angular/platform-browser';
|
||||
import {bootstrap} from '@angular/platform-browser-dynamic';
|
||||
import {Component} from '@angular/core';
|
||||
|
||||
@Component({
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import {bootstrap} from '@angular/platform-browser';
|
||||
import {bootstrap} from '@angular/platform-browser-dynamic';
|
||||
import {Component} from '@angular/core';
|
||||
|
||||
@Component({selector: '[svg-group]', template: `<svg:text x="20" y="20">Hello</svg:text>`})
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import {bootstrap} from '@angular/platform-browser';
|
||||
import {bootstrap} from '@angular/platform-browser-dynamic';
|
||||
import {Component, Directive, Host} from '@angular/core';
|
||||
import {
|
||||
ControlGroup,
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import {bootstrap} from '@angular/platform-browser';
|
||||
import {bootstrap} from '@angular/platform-browser-dynamic';
|
||||
import {Component} from '@angular/core';
|
||||
import {NgFor} from '@angular/common';
|
||||
import {Store, Todo, TodoFactory} from './app/TodoStore';
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import {ImageDemo} from './index_common';
|
||||
import {bootstrapApp} from '@angular/platform-browser';
|
||||
import {bootstrapApp} from '@angular/platform-browser-dynamic';
|
||||
|
||||
export function main() {
|
||||
bootstrapApp(ImageDemo);
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import {bootstrapRender} from '@angular/platform-browser';
|
||||
import {bootstrapRender} from '@angular/platform-browser-dynamic';
|
||||
|
||||
export function main() {
|
||||
bootstrapRender("loader.js");
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import {bootstrap} from '@angular/platform-browser';
|
||||
import {bootstrap} from '@angular/platform-browser-dynamic';
|
||||
import {ImageDemo} from './index_common';
|
||||
|
||||
export function main() {
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import {InputCmp} from './index_common';
|
||||
import {bootstrapApp} from '@angular/platform-browser';
|
||||
import {bootstrapApp} from '@angular/platform-browser-dynamic';
|
||||
|
||||
export function main() {
|
||||
bootstrapApp(InputCmp);
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import {bootstrapRender} from '@angular/platform-browser';
|
||||
import {bootstrapRender} from '@angular/platform-browser-dynamic';
|
||||
|
||||
export function main() {
|
||||
bootstrapRender("loader.js");
|
||||
|
|
|
@ -15,6 +15,7 @@ System.config({
|
|||
'@angular/compiler': {main: 'index.js', defaultExtension: 'js'},
|
||||
'@angular/common': {main: 'index.js', defaultExtension: 'js'},
|
||||
'@angular/platform-browser': {main: 'index.js', defaultExtension: 'js'},
|
||||
'@angular/platform-browser-dynamic': {main: 'index.js', defaultExtension: 'js'},
|
||||
'@angular/router': {main: 'index.js', defaultExtension: 'js'},
|
||||
'rxjs': {
|
||||
defaultExtension: 'js'
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import {HelloCmp} from './index_common';
|
||||
import {bootstrapApp} from '@angular/platform-browser';
|
||||
import {bootstrapApp} from '@angular/platform-browser-dynamic';
|
||||
|
||||
export function main() {
|
||||
bootstrapApp(HelloCmp);
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import {bootstrapRender} from '@angular/platform-browser';
|
||||
import {bootstrapRender} from '@angular/platform-browser-dynamic';
|
||||
|
||||
export function main() {
|
||||
bootstrapRender("loader.js");
|
||||
|
|
|
@ -15,6 +15,7 @@ System.config({
|
|||
'@angular/compiler': {main: 'index.js', defaultExtension: 'js'},
|
||||
'@angular/common': {main: 'index.js', defaultExtension: 'js'},
|
||||
'@angular/platform-browser': {main: 'index.js', defaultExtension: 'js'},
|
||||
'@angular/platform-browser-dynamic': {main: 'index.js', defaultExtension: 'js'},
|
||||
'@angular/router': {main: 'index.js', defaultExtension: 'js'},
|
||||
'rxjs': {
|
||||
defaultExtension: 'js'
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import {bootstrapApp} from '@angular/platform-browser';
|
||||
import {bootstrapApp} from '@angular/platform-browser-dynamic';
|
||||
import {App} from './index_common';
|
||||
|
||||
export function main() {
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
import {ApplicationRef} from '@angular/core';
|
||||
import {bootstrapRender, UiArguments, FnArg, PRIMITIVE, ClientMessageBrokerFactory} from '@angular/platform-browser';
|
||||
import {UiArguments, FnArg, PRIMITIVE, ClientMessageBrokerFactory} from '@angular/platform-browser';
|
||||
import {bootstrapRender} from "@angular/platform-browser-dynamic";
|
||||
|
||||
const ECHO_CHANNEL = "ECHO";
|
||||
|
||||
|
|
|
@ -15,6 +15,7 @@ System.config({
|
|||
'@angular/compiler': {main: 'index.js', defaultExtension: 'js'},
|
||||
'@angular/common': {main: 'index.js', defaultExtension: 'js'},
|
||||
'@angular/platform-browser': {main: 'index.js', defaultExtension: 'js'},
|
||||
'@angular/platform-browser-dynamic': {main: 'index.js', defaultExtension: 'js'},
|
||||
'@angular/router': {main: 'index.js', defaultExtension: 'js'},
|
||||
'rxjs': {
|
||||
defaultExtension: 'js'
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
import {ROUTER_PROVIDERS} from '@angular/router-deprecated';
|
||||
import {bootstrapApp, WORKER_APP_LOCATION_PROVIDERS} from '@angular/platform-browser';
|
||||
import {WORKER_APP_LOCATION_PROVIDERS} from '@angular/platform-browser';
|
||||
import {bootstrapApp} from '@angular/platform-browser-dynamic';
|
||||
|
||||
import {HashLocationStrategy, LocationStrategy} from '@angular/common';
|
||||
import {App} from './index_common';
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
import {bootstrapRender, WORKER_RENDER_LOCATION_PROVIDERS} from '@angular/platform-browser';
|
||||
import {WORKER_RENDER_LOCATION_PROVIDERS} from '@angular/platform-browser';
|
||||
import {bootstrapRender} from "@angular/platform-browser-dynamic";
|
||||
|
||||
export function main() {
|
||||
bootstrapRender("loader.js", WORKER_RENDER_LOCATION_PROVIDERS);
|
||||
|
|
|
@ -15,6 +15,7 @@ System.config({
|
|||
'@angular/compiler': {main: 'index.js', defaultExtension: 'js'},
|
||||
'@angular/common': {main: 'index.js', defaultExtension: 'js'},
|
||||
'@angular/platform-browser': {main: 'index.js', defaultExtension: 'js'},
|
||||
'@angular/platform-browser-dynamic': {main: 'index.js', defaultExtension: 'js'},
|
||||
'@angular/router': {main: 'index.js', defaultExtension: 'js'},
|
||||
'@angular/router-deprecated': {main: 'index.js', defaultExtension: 'js'},
|
||||
'rxjs': {
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import {TodoApp} from './index_common';
|
||||
import {bootstrapApp} from '@angular/platform-browser';
|
||||
import {bootstrapApp} from '@angular/platform-browser-dynamic';
|
||||
|
||||
export function main() {
|
||||
bootstrapApp(TodoApp);
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import {bootstrapRender} from '@angular/platform-browser';
|
||||
import {bootstrapRender} from '@angular/platform-browser-dynamic';
|
||||
|
||||
export function main() {
|
||||
bootstrapRender("loader.js");
|
||||
|
|
|
@ -15,6 +15,7 @@ System.config({
|
|||
'@angular/compiler': {main: 'index.js', defaultExtension: 'js'},
|
||||
'@angular/common': {main: 'index.js', defaultExtension: 'js'},
|
||||
'@angular/platform-browser': {main: 'index.js', defaultExtension: 'js'},
|
||||
'@angular/platform-browser-dynamic': {main: 'index.js', defaultExtension: 'js'},
|
||||
'@angular/router': {main: 'index.js', defaultExtension: 'js'},
|
||||
'rxjs': {
|
||||
defaultExtension: 'js'
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import {bootstrap} from '@angular/platform-browser';
|
||||
import {bootstrap} from '@angular/platform-browser-dynamic';
|
||||
import {Component} from '@angular/core';
|
||||
import {Zippy} from './app/zippy';
|
||||
|
||||
|
|
10
test-main.js
10
test-main.js
|
@ -57,6 +57,10 @@ System.config({
|
|||
main: 'index.js',
|
||||
defaultExtension: 'js'
|
||||
},
|
||||
'@angular/platform-browser-dynamic': {
|
||||
main: 'index.js',
|
||||
defaultExtension: 'js'
|
||||
},
|
||||
'@angular/platform-server': {
|
||||
main: 'index.js',
|
||||
defaultExtension: 'js'
|
||||
|
@ -69,11 +73,11 @@ System.config({
|
|||
// method and kick off Karma (Jasmine).
|
||||
System.import('@angular/core/testing')
|
||||
.then(function(coreTesting){
|
||||
return System.import('@angular/platform-browser/testing')
|
||||
return System.import('@angular/platform-browser-dynamic/testing')
|
||||
.then(function(browserTesting){
|
||||
coreTesting.setBaseTestProviders(
|
||||
browserTesting.TEST_BROWSER_PLATFORM_PROVIDERS,
|
||||
browserTesting.TEST_BROWSER_APPLICATION_PROVIDERS
|
||||
browserTesting.TEST_BROWSER_DYNAMIC_PLATFORM_PROVIDERS,
|
||||
browserTesting.TEST_BROWSER_DYNAMIC_APPLICATION_PROVIDERS
|
||||
);
|
||||
});
|
||||
})
|
||||
|
|
|
@ -39,6 +39,7 @@ var specFiles: any =
|
|||
ignore: [
|
||||
// the following code and tests are not compatible with CJS/node environment
|
||||
'@angular/platform-browser/**',
|
||||
'@angular/platform-browser-dynamic/**',
|
||||
'@angular/core/test/zone/**',
|
||||
'@angular/core/test/fake_async_spec.*',
|
||||
'@angular/common/test/forms/**',
|
||||
|
|
|
@ -1483,9 +1483,6 @@ const UPGRADE = [
|
|||
];
|
||||
|
||||
const PLATFORM_BROWSER = [
|
||||
'bootstrap(appComponentType:Type, customProviders?:Array<any>):Promise<ComponentRef<any>>',
|
||||
'bootstrapApp(appComponentType:Type, customProviders?:Array<any>):Promise<ComponentRef<any>>',
|
||||
'bootstrapRender(workerScriptUri:string, customProviders?:Array<any>):Promise<ApplicationRef>',
|
||||
'browserPlatform():PlatformRef',
|
||||
'BrowserPlatformLocation',
|
||||
'BrowserPlatformLocation.back():void',
|
||||
|
@ -1509,12 +1506,10 @@ const PLATFORM_BROWSER = [
|
|||
'ClientMessageBroker.runOnService(args:UiArguments, returnType:Type):Promise<any>',
|
||||
'ClientMessageBrokerFactory',
|
||||
'ClientMessageBrokerFactory.createMessageBroker(channel:string, runInZone?:boolean):ClientMessageBroker',
|
||||
'const BROWSER_APP_COMPILER_PROVIDERS:Array<any>',
|
||||
'const BROWSER_APP_PROVIDERS:Array<any>',
|
||||
'const BROWSER_PLATFORM_PROVIDERS:Array<any>',
|
||||
'const BROWSER_PROVIDERS:any[]',
|
||||
'const BROWSER_SANITIZATION_PROVIDERS:Array<any>',
|
||||
'const CACHED_TEMPLATE_PROVIDER:Array<any>',
|
||||
'const DOCUMENT:OpaqueToken',
|
||||
'const ELEMENT_PROBE_PROVIDERS:any[]',
|
||||
'const EVENT_MANAGER_PLUGINS:OpaqueToken',
|
||||
|
@ -1597,6 +1592,7 @@ const PLATFORM_BROWSER = [
|
|||
'UiArguments.args?:FnArg[]',
|
||||
'UiArguments.constructor(method:string, args?:FnArg[])',
|
||||
'UiArguments.method:string',
|
||||
'var __platform_browser_private__:any',
|
||||
'var SecurityContext:unknown',
|
||||
'WebWorkerInstance',
|
||||
'WebWorkerInstance.bus:MessageBus',
|
||||
|
@ -1619,16 +1615,9 @@ const PLATFORM_BROWSER_TESTING = [
|
|||
'BrowserDetection.isWebkit:boolean',
|
||||
'BrowserDetection.setup():any',
|
||||
'BrowserDetection.supportsIntlApi:boolean',
|
||||
'const ADDITIONAL_TEST_BROWSER_PROVIDERS:any',
|
||||
'const ADDITIONAL_TEST_BROWSER_STATIC_PROVIDERS:Array<any>',
|
||||
'const TEST_BROWSER_APPLICATION_PROVIDERS:Array<any>',
|
||||
'const TEST_BROWSER_PLATFORM_PROVIDERS:Array<any>',
|
||||
'const TEST_BROWSER_STATIC_APPLICATION_PROVIDERS:Array<any>',
|
||||
'const TEST_BROWSER_STATIC_PLATFORM_PROVIDERS:Array<any>',
|
||||
'dispatchEvent(element:any, eventType:any):void',
|
||||
'DOMTestComponentRenderer',
|
||||
'DOMTestComponentRenderer.constructor(_doc:any)',
|
||||
'DOMTestComponentRenderer.insertRootElement(rootElId:string):any',
|
||||
'el(html:string):HTMLElement',
|
||||
'NgMatchers',
|
||||
'NgMatchers.not:NgMatchers',
|
||||
|
@ -1654,6 +1643,23 @@ const PLATFORM_BROWSER_TESTING_E2E = [
|
|||
'verifyNoBrowserErrors():any',
|
||||
];
|
||||
|
||||
|
||||
const PLATFORM_BROWSER_DYNAMIC = [
|
||||
'bootstrap(appComponentType:Type, customProviders?:Array<any>):Promise<ComponentRef<any>>',
|
||||
'bootstrapApp(appComponentType:Type, customProviders?:Array<any>):Promise<ComponentRef<any>>',
|
||||
'bootstrapRender(workerScriptUri:string, customProviders?:Array<any>):Promise<ApplicationRef>',
|
||||
'const BROWSER_APP_COMPILER_PROVIDERS:Array<any>',
|
||||
'const CACHED_TEMPLATE_PROVIDER:Array<any>',
|
||||
];
|
||||
|
||||
|
||||
const PLATFORM_BROWSER_DYNAMIC_TESTING = [
|
||||
'const TEST_BROWSER_DYNAMIC_APPLICATION_PROVIDERS:Array<any>',
|
||||
'const TEST_BROWSER_DYNAMIC_PLATFORM_PROVIDERS:Array<any>',
|
||||
];
|
||||
|
||||
|
||||
|
||||
const PLATFORM_SERVER = [
|
||||
'const SERVER_APPLICATION_PROVIDERS:Array<any>',
|
||||
'const SERVER_PLATFORM_PROVIDERS:Array<any>',
|
||||
|
@ -1854,6 +1860,8 @@ describe('public API', () => {
|
|||
check('@angular/platform-browser/index.ts', PLATFORM_BROWSER);
|
||||
check('@angular/platform-browser/testing.ts', PLATFORM_BROWSER_TESTING);
|
||||
check('@angular/platform-browser/testing_e2e.ts', PLATFORM_BROWSER_TESTING_E2E);
|
||||
check('@angular/platform-browser-dynamic/index.ts', PLATFORM_BROWSER_DYNAMIC);
|
||||
check('@angular/platform-browser-dynamic/testing.ts', PLATFORM_BROWSER_DYNAMIC_TESTING);
|
||||
check('@angular/platform-server/index.ts', PLATFORM_SERVER);
|
||||
check('@angular/platform-server/testing.ts', PLATFORM_SERVER_TESTING);
|
||||
check('@angular/http/index.ts', HTTP);
|
||||
|
|
Loading…
Reference in New Issue