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
|
|
|
|
*/
|
|
|
|
|
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-06-10 13:21:53 -04:00
|
|
|
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;
|
2016-06-27 15:27:23 -04:00
|
|
|
export var ELEMENT_PROBE_PROVIDERS: typeof ng_proble.ELEMENT_PROBE_PROVIDERS;
|
|
|
|
export type DomEventsPlugin = dom_events.DomEventsPlugin;
|
|
|
|
export var DomEventsPlugin: typeof dom_events.DomEventsPlugin;
|
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
|
|
|
export var initDomAdapter: typeof browser.initDomAdapter;
|
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,
|
|
|
|
initDomAdapter: browser.initDomAdapter
|
2016-06-10 13:21:53 -04:00
|
|
|
};
|