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
|
|
|
/** @experimental */
|
|
|
|
export declare abstract class AnimationDriver {
|
|
|
|
abstract animate(element: any, startingStyles: AnimationStyles, keyframes: AnimationKeyframe[], duration: number, delay: number, easing: string): AnimationPlayer;
|
|
|
|
static NOOP: AnimationDriver;
|
|
|
|
}
|
|
|
|
|
2016-08-23 18:41:05 -04:00
|
|
|
/** @stable */
|
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 declare class BrowserModule {
|
2016-08-18 16:34:28 -04:00
|
|
|
constructor(parentModule: BrowserModule);
|
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
|
|
|
}
|
|
|
|
|
2016-06-27 15:27:23 -04:00
|
|
|
/** @experimental */
|
2016-06-22 17:56:10 -04:00
|
|
|
export declare class By {
|
|
|
|
static all(): Predicate<DebugElement>;
|
|
|
|
static css(selector: string): Predicate<DebugElement>;
|
2016-08-10 21:21:28 -04:00
|
|
|
static directive(type: Type<any>): Predicate<DebugElement>;
|
2016-06-22 17:56:10 -04:00
|
|
|
}
|
|
|
|
|
2016-06-27 15:27:23 -04:00
|
|
|
/** @experimental */
|
2016-06-22 17:56:10 -04:00
|
|
|
export declare function disableDebugTools(): void;
|
|
|
|
|
2016-06-27 15:27:23 -04:00
|
|
|
/** @stable */
|
2016-06-22 17:56:10 -04:00
|
|
|
export declare const DOCUMENT: OpaqueToken;
|
|
|
|
|
2016-06-27 15:27:23 -04:00
|
|
|
/** @stable */
|
2016-08-25 18:41:19 -04:00
|
|
|
export declare abstract class DomSanitizer implements Sanitizer {
|
2016-06-22 17:56:10 -04:00
|
|
|
abstract bypassSecurityTrustHtml(value: string): SafeHtml;
|
2016-06-23 21:19:32 -04:00
|
|
|
abstract bypassSecurityTrustResourceUrl(value: string): SafeResourceUrl;
|
2016-06-22 17:56:10 -04:00
|
|
|
abstract bypassSecurityTrustScript(value: string): SafeScript;
|
2016-06-23 21:19:32 -04:00
|
|
|
abstract bypassSecurityTrustStyle(value: string): SafeStyle;
|
2016-06-22 17:56:10 -04:00
|
|
|
abstract bypassSecurityTrustUrl(value: string): SafeUrl;
|
2016-06-23 21:19:32 -04:00
|
|
|
abstract sanitize(context: SecurityContext, value: any): string;
|
2016-06-22 17:56:10 -04:00
|
|
|
}
|
|
|
|
|
2016-06-27 15:27:23 -04:00
|
|
|
/** @experimental */
|
2016-06-22 17:56:10 -04:00
|
|
|
export declare function enableDebugTools<T>(ref: ComponentRef<T>): ComponentRef<T>;
|
|
|
|
|
2016-06-27 15:27:23 -04:00
|
|
|
/** @stable */
|
2016-06-22 17:56:10 -04:00
|
|
|
export declare const EVENT_MANAGER_PLUGINS: OpaqueToken;
|
|
|
|
|
2016-06-27 15:27:23 -04:00
|
|
|
/** @stable */
|
2016-06-22 17:56:10 -04:00
|
|
|
export declare class EventManager {
|
|
|
|
constructor(plugins: EventManagerPlugin[], _zone: NgZone);
|
|
|
|
addEventListener(element: HTMLElement, eventName: string, handler: Function): Function;
|
|
|
|
addGlobalEventListener(target: string, eventName: string, handler: Function): Function;
|
|
|
|
getZone(): NgZone;
|
|
|
|
}
|
|
|
|
|
2016-06-27 15:27:23 -04:00
|
|
|
/** @experimental */
|
2016-06-22 17:56:10 -04:00
|
|
|
export declare const HAMMER_GESTURE_CONFIG: OpaqueToken;
|
|
|
|
|
2016-06-27 15:27:23 -04:00
|
|
|
/** @experimental */
|
2016-06-22 17:56:10 -04:00
|
|
|
export declare class HammerGestureConfig {
|
|
|
|
events: string[];
|
|
|
|
overrides: {
|
|
|
|
[key: string]: Object;
|
|
|
|
};
|
|
|
|
buildHammer(element: HTMLElement): HammerInstance;
|
|
|
|
}
|
|
|
|
|
2016-11-09 17:58:40 -05:00
|
|
|
/** @deprecated */
|
2016-08-11 01:17:20 -04:00
|
|
|
export declare class NgProbeToken {
|
2016-11-09 17:58:40 -05:00
|
|
|
name: string;
|
|
|
|
token: any;
|
2016-08-11 01:17:20 -04:00
|
|
|
constructor(name: string, token: any);
|
|
|
|
}
|
|
|
|
|
2016-08-23 18:41:05 -04:00
|
|
|
/** @stable */
|
2016-08-30 21:07:40 -04:00
|
|
|
export declare const platformBrowser: (extraProviders?: Provider[]) => PlatformRef;
|
2016-07-25 08:47:16 -04:00
|
|
|
|
2016-06-27 15:27:23 -04:00
|
|
|
/** @stable */
|
2016-06-22 17:56:10 -04:00
|
|
|
export interface SafeHtml extends SafeValue {
|
|
|
|
}
|
|
|
|
|
2016-06-27 15:27:23 -04:00
|
|
|
/** @stable */
|
2016-06-22 17:56:10 -04:00
|
|
|
export interface SafeResourceUrl extends SafeValue {
|
|
|
|
}
|
|
|
|
|
2016-06-27 15:27:23 -04:00
|
|
|
/** @stable */
|
2016-06-22 17:56:10 -04:00
|
|
|
export interface SafeScript extends SafeValue {
|
|
|
|
}
|
|
|
|
|
2016-06-27 15:27:23 -04:00
|
|
|
/** @stable */
|
2016-06-22 17:56:10 -04:00
|
|
|
export interface SafeStyle extends SafeValue {
|
|
|
|
}
|
|
|
|
|
2016-06-27 15:27:23 -04:00
|
|
|
/** @stable */
|
2016-06-22 17:56:10 -04:00
|
|
|
export interface SafeUrl extends SafeValue {
|
|
|
|
}
|
|
|
|
|
2016-06-27 13:02:02 -04:00
|
|
|
/** @experimental */
|
2016-06-22 17:56:10 -04:00
|
|
|
export declare class Title {
|
|
|
|
getTitle(): string;
|
|
|
|
setTitle(newTitle: string): void;
|
|
|
|
}
|