2016-06-23 12:47:54 -04:00
|
|
|
/**
|
|
|
|
* @license
|
|
|
|
* Copyright Google Inc. All Rights Reserved.
|
|
|
|
*
|
|
|
|
* Use of this source code is governed by an MIT-style license that can be
|
|
|
|
* found in the LICENSE file at https://angular.io/license
|
|
|
|
*/
|
|
|
|
|
2016-08-15 22:37:42 -04:00
|
|
|
import {ClassProvider, ExistingProvider, FactoryProvider, TypeProvider, ValueProvider} from '@angular/core';
|
|
|
|
|
feat(browser): use AppModules for bootstrap in the browser
This introduces the `BrowserModule` to be used for long form
bootstrap and offline compile bootstrap:
```
@AppModule({
modules: [BrowserModule],
precompile: [MainComponent],
providers: […], // additional providers
directives: […], // additional platform directives
pipes: […] // additional platform pipes
})
class MyModule {
constructor(appRef: ApplicationRef) {
appRef.bootstrap(MainComponent);
}
}
// offline compile
import {bootstrapModuleFactory} from ‘@angular/platform-browser’;
bootstrapModuleFactory(MyModuleNgFactory);
// runtime compile long form
import {bootstrapModule} from ‘@angular/platform-browser-dynamic’;
bootstrapModule(MyModule);
```
The short form, `bootstrap(...)`, can now creates a module on the fly,
given `directives`, `pipes, `providers`, `precompile` and `modules`
properties.
Related changes:
- make `SanitizationService`, `SecurityContext` public in `@angular/core` so that the offline compiler can resolve the token
- move `AnimationDriver` to `platform-browser` and make it
public so that the offline compiler can resolve the token
BREAKING CHANGES:
- short form bootstrap does no longer allow
to inject compiler internals (i.e. everything
from `@angular/compiler). Inject `Compiler` instead.
To provide custom providers for the compiler,
create a custom compiler via `browserCompiler({providers: [...]})`
and pass that into the `bootstrap` method.
2016-06-30 16:07:17 -04:00
|
|
|
import * as browser from './src/browser';
|
2016-06-27 15:27:23 -04:00
|
|
|
import * as ng_proble from './src/dom/debug/ng_probe';
|
2016-04-28 20:50:03 -04:00
|
|
|
import * as dom_adapter from './src/dom/dom_adapter';
|
2016-05-27 15:36:24 -04:00
|
|
|
import * as dom_renderer from './src/dom/dom_renderer';
|
2016-06-27 15:27:23 -04:00
|
|
|
import * as dom_events from './src/dom/events/dom_events';
|
2016-05-27 15:36:24 -04:00
|
|
|
import * as shared_styles_host from './src/dom/shared_styles_host';
|
2016-04-28 20:50:03 -04:00
|
|
|
|
2016-08-23 19:18:11 -04:00
|
|
|
export interface __platform_browser_private_types__ {
|
|
|
|
DomAdapter: dom_adapter.DomAdapter;
|
|
|
|
DomRootRenderer: dom_renderer.DomRootRenderer;
|
|
|
|
DomRootRenderer_: dom_renderer.DomRootRenderer_;
|
|
|
|
DomSharedStylesHost: shared_styles_host.DomSharedStylesHost;
|
|
|
|
SharedStylesHost: shared_styles_host.SharedStylesHost;
|
|
|
|
DomEventsPlugin: dom_events.DomEventsPlugin;
|
2016-06-08 19:38:52 -04:00
|
|
|
}
|
2016-04-28 20:50:03 -04:00
|
|
|
|
2016-06-10 13:21:53 -04:00
|
|
|
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,
|
2016-06-27 15:27:23 -04:00
|
|
|
SharedStylesHost: shared_styles_host.SharedStylesHost,
|
|
|
|
ELEMENT_PROBE_PROVIDERS: ng_proble.ELEMENT_PROBE_PROVIDERS,
|
feat(browser): use AppModules for bootstrap in the browser
This introduces the `BrowserModule` to be used for long form
bootstrap and offline compile bootstrap:
```
@AppModule({
modules: [BrowserModule],
precompile: [MainComponent],
providers: […], // additional providers
directives: […], // additional platform directives
pipes: […] // additional platform pipes
})
class MyModule {
constructor(appRef: ApplicationRef) {
appRef.bootstrap(MainComponent);
}
}
// offline compile
import {bootstrapModuleFactory} from ‘@angular/platform-browser’;
bootstrapModuleFactory(MyModuleNgFactory);
// runtime compile long form
import {bootstrapModule} from ‘@angular/platform-browser-dynamic’;
bootstrapModule(MyModule);
```
The short form, `bootstrap(...)`, can now creates a module on the fly,
given `directives`, `pipes, `providers`, `precompile` and `modules`
properties.
Related changes:
- make `SanitizationService`, `SecurityContext` public in `@angular/core` so that the offline compiler can resolve the token
- move `AnimationDriver` to `platform-browser` and make it
public so that the offline compiler can resolve the token
BREAKING CHANGES:
- short form bootstrap does no longer allow
to inject compiler internals (i.e. everything
from `@angular/compiler). Inject `Compiler` instead.
To provide custom providers for the compiler,
create a custom compiler via `browserCompiler({providers: [...]})`
and pass that into the `bootstrap` method.
2016-06-30 16:07:17 -04:00
|
|
|
DomEventsPlugin: dom_events.DomEventsPlugin,
|
2016-07-18 06:50:31 -04:00
|
|
|
initDomAdapter: browser.initDomAdapter,
|
|
|
|
INTERNAL_BROWSER_PLATFORM_PROVIDERS: browser.INTERNAL_BROWSER_PLATFORM_PROVIDERS
|
2016-06-10 13:21:53 -04:00
|
|
|
};
|