chore: audit @angular/core API classification (#8808)
This commit is contained in:
@ -16,6 +16,7 @@ let __unused: Type; // avoid unused import when Type union types are erased
|
||||
/**
|
||||
* A default set of providers which should be included in any Angular
|
||||
* application, regardless of the platform it runs onto.
|
||||
* @stable
|
||||
*/
|
||||
export const APPLICATION_COMMON_PROVIDERS: Array<Type | {[k: string]: any} | any[]> =
|
||||
/*@ts2dart_const*/[
|
||||
|
@ -14,6 +14,7 @@ import {ChangeDetectorRef} from './change_detection/change_detector_ref';
|
||||
|
||||
/**
|
||||
* Create an Angular zone.
|
||||
* @experimental
|
||||
*/
|
||||
export function createNgZone(): NgZone {
|
||||
return new NgZone({enableLongStackTrace: assertionsEnabled()});
|
||||
@ -25,6 +26,7 @@ var _inPlatformCreate: boolean = false;
|
||||
/**
|
||||
* Creates a platform.
|
||||
* Platforms have to be eagerly created via this function.
|
||||
* @experimental
|
||||
*/
|
||||
export function createPlatform(injector: Injector): PlatformRef {
|
||||
if (_inPlatformCreate) {
|
||||
@ -47,6 +49,7 @@ export function createPlatform(injector: Injector): PlatformRef {
|
||||
/**
|
||||
* Checks that there currently is a platform
|
||||
* which contains the given token as a provider.
|
||||
* @experimental
|
||||
*/
|
||||
export function assertPlatform(requiredToken: any): PlatformRef {
|
||||
var platform = getPlatform();
|
||||
@ -62,6 +65,7 @@ export function assertPlatform(requiredToken: any): PlatformRef {
|
||||
|
||||
/**
|
||||
* Dispose the existing platform.
|
||||
* @experimental
|
||||
*/
|
||||
export function disposePlatform(): void {
|
||||
if (isPresent(_platform) && !_platform.disposed) {
|
||||
@ -71,6 +75,7 @@ export function disposePlatform(): void {
|
||||
|
||||
/**
|
||||
* Returns the current platform.
|
||||
* @experimental
|
||||
*/
|
||||
export function getPlatform(): PlatformRef {
|
||||
return isPresent(_platform) && !_platform.disposed ? _platform : null;
|
||||
@ -79,6 +84,7 @@ export function getPlatform(): PlatformRef {
|
||||
/**
|
||||
* Shortcut for ApplicationRef.bootstrap.
|
||||
* Requires a platform to be created first.
|
||||
* @experimental
|
||||
*/
|
||||
export function coreBootstrap<C>(componentFactory: ComponentFactory<C>,
|
||||
injector: Injector): ComponentRef<C> {
|
||||
@ -90,6 +96,7 @@ export function coreBootstrap<C>(componentFactory: ComponentFactory<C>,
|
||||
* Resolves the componentFactory for the given component,
|
||||
* waits for asynchronous initializers and bootstraps the component.
|
||||
* Requires a platform to be created first.
|
||||
* @experimental
|
||||
*/
|
||||
export function coreLoadAndBootstrap(componentType: Type,
|
||||
injector: Injector): Promise<ComponentRef<any>> {
|
||||
@ -109,6 +116,7 @@ export function coreLoadAndBootstrap(componentType: Type,
|
||||
*
|
||||
* A page's platform is initialized implicitly when {@link bootstrap}() is called, or
|
||||
* explicitly by calling {@link createPlatform}().
|
||||
* @stable
|
||||
*/
|
||||
export abstract class PlatformRef {
|
||||
/**
|
||||
@ -170,6 +178,7 @@ export class PlatformRef_ extends PlatformRef {
|
||||
* A reference to an Angular application running on a page.
|
||||
*
|
||||
* For more about Angular applications, see the documentation for {@link bootstrap}.
|
||||
* @stable
|
||||
*/
|
||||
export abstract class ApplicationRef {
|
||||
/**
|
||||
|
@ -9,6 +9,7 @@ import {Math, StringWrapper} from '../src/facade/lang';
|
||||
* If you need to avoid randomly generated value to be used as an application id, you can provide
|
||||
* a custom value via a DI provider <!-- TODO: provider --> configuring the root {@link Injector}
|
||||
* using this token.
|
||||
* @experimental
|
||||
*/
|
||||
export const APP_ID: any = /*@ts2dart_const*/ new OpaqueToken('AppId');
|
||||
|
||||
@ -18,6 +19,7 @@ function _appIdRandomProviderFactory() {
|
||||
|
||||
/**
|
||||
* Providers that will generate a random APP_ID_TOKEN.
|
||||
* @experimental
|
||||
*/
|
||||
export const APP_ID_RANDOM_PROVIDER =
|
||||
/*@ts2dart_const*/ /* @ts2dart_Provider */ {
|
||||
@ -32,18 +34,21 @@ function _randomChar(): string {
|
||||
|
||||
/**
|
||||
* A function that will be executed when a platform is initialized.
|
||||
* @experimental
|
||||
*/
|
||||
export const PLATFORM_INITIALIZER: any =
|
||||
/*@ts2dart_const*/ new OpaqueToken("Platform Initializer");
|
||||
|
||||
/**
|
||||
* A function that will be executed when an application is initialized.
|
||||
* @experimental
|
||||
*/
|
||||
export const APP_INITIALIZER: any =
|
||||
/*@ts2dart_const*/ new OpaqueToken("Application Initializer");
|
||||
|
||||
/**
|
||||
* A token which indicates the root directory of the application
|
||||
* @experimental
|
||||
*/
|
||||
export const PACKAGE_ROOT_URL: any =
|
||||
/*@ts2dart_const*/ new OpaqueToken("Application Packages Root URL");
|
||||
|
@ -34,6 +34,7 @@ export function devModeEqual(a: any, b: any): boolean {
|
||||
* return WrappedValue.wrap(this._latestValue); // this will force update
|
||||
* }
|
||||
* ```
|
||||
* @stable
|
||||
*/
|
||||
export class WrappedValue {
|
||||
constructor(public wrapped: any) {}
|
||||
@ -60,6 +61,7 @@ export class ValueUnwrapper {
|
||||
|
||||
/**
|
||||
* Represents a basic change from a previous to a new value.
|
||||
* @stable
|
||||
*/
|
||||
export class SimpleChange {
|
||||
constructor(public previousValue: any, public currentValue: any) {}
|
||||
|
@ -1,3 +1,6 @@
|
||||
/**
|
||||
* @stable
|
||||
*/
|
||||
export abstract class ChangeDetectorRef {
|
||||
/**
|
||||
* Marks all {@link ChangeDetectionStrategy#OnPush} ancestors as to be checked.
|
||||
|
@ -28,6 +28,7 @@ export enum ChangeDetectorState {
|
||||
/**
|
||||
* Describes within the change detector which strategy will be used the next time change
|
||||
* detection is triggered.
|
||||
* @stable
|
||||
*/
|
||||
export enum ChangeDetectionStrategy {
|
||||
/**
|
||||
|
@ -24,6 +24,9 @@ export class DefaultIterableDifferFactory implements IterableDifferFactory {
|
||||
|
||||
var trackByIdentity = (index: number, item: any) => item;
|
||||
|
||||
/**
|
||||
* @stable
|
||||
*/
|
||||
export class DefaultIterableDiffer implements IterableDiffer {
|
||||
private _length: number = null;
|
||||
private _collection = null;
|
||||
@ -532,6 +535,9 @@ export class DefaultIterableDiffer implements IterableDiffer {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @stable
|
||||
*/
|
||||
export class CollectionChangeRecord {
|
||||
currentIndex: number = null;
|
||||
previousIndex: number = null;
|
||||
|
@ -335,6 +335,9 @@ export class DefaultKeyValueDiffer implements KeyValueDiffer {
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @stable
|
||||
*/
|
||||
export class KeyValueChangeRecord {
|
||||
previousValue: any = null;
|
||||
currentValue: any = null;
|
||||
|
@ -7,6 +7,8 @@ import {Provider, SkipSelfMetadata, OptionalMetadata} from '../../di';
|
||||
/**
|
||||
* A strategy for tracking changes over time to an iterable. Used for {@link NgFor} to
|
||||
* respond to changes in an iterable by effecting equivalent changes in the DOM.
|
||||
*
|
||||
* @stable
|
||||
*/
|
||||
export interface IterableDiffer {
|
||||
diff(object: any): any;
|
||||
@ -31,6 +33,7 @@ export interface IterableDifferFactory {
|
||||
/**
|
||||
* A repository of different iterable diffing strategies used by NgFor, NgClass, and others.
|
||||
* @ts2dart_const
|
||||
* @stable
|
||||
*/
|
||||
export class IterableDiffers {
|
||||
/*@ts2dart_const*/
|
||||
|
@ -23,6 +23,7 @@ export interface KeyValueDifferFactory {
|
||||
/**
|
||||
* A repository of different Map diffing strategies used by NgClass, NgStyle, and others.
|
||||
* @ts2dart_const
|
||||
* @stable
|
||||
*/
|
||||
export class KeyValueDiffers {
|
||||
/*@ts2dart_const*/
|
||||
|
@ -5,6 +5,9 @@ import {RenderDebugInfo} from '../render/api';
|
||||
|
||||
export class EventListener { constructor(public name: string, public callback: Function){}; }
|
||||
|
||||
/**
|
||||
* @experimental
|
||||
*/
|
||||
export class DebugNode {
|
||||
nativeNode: any;
|
||||
listeners: EventListener[];
|
||||
@ -46,6 +49,9 @@ export class DebugNode {
|
||||
inject(token: any): any { return this.injector.get(token); }
|
||||
}
|
||||
|
||||
/**
|
||||
* @experimental
|
||||
*/
|
||||
export class DebugElement extends DebugNode {
|
||||
name: string;
|
||||
properties: {[key: string]: string};
|
||||
@ -129,6 +135,9 @@ export class DebugElement extends DebugNode {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @experimental
|
||||
*/
|
||||
export function asNativeElements(debugEls: DebugElement[]): any {
|
||||
return debugEls.map((el) => el.nativeElement);
|
||||
}
|
||||
@ -162,6 +171,9 @@ function _queryNodeChildren(parentNode: DebugNode, predicate: Predicate<DebugNod
|
||||
// Need to keep the nodes in a global Map so that multiple angular apps are supported.
|
||||
var _nativeNodeToDebugNode = new Map<any, DebugNode>();
|
||||
|
||||
/**
|
||||
* @experimental
|
||||
*/
|
||||
export function getDebugNode(nativeNode: any): DebugNode {
|
||||
return _nativeNodeToDebugNode.get(nativeNode);
|
||||
}
|
||||
|
@ -10,8 +10,7 @@ export {
|
||||
InjectableMetadata,
|
||||
SelfMetadata,
|
||||
HostMetadata,
|
||||
SkipSelfMetadata,
|
||||
DependencyMetadata
|
||||
SkipSelfMetadata
|
||||
} from './di/metadata';
|
||||
|
||||
// we have to reexport * because Dart and TS export two different sets of types
|
||||
@ -25,15 +24,12 @@ export {
|
||||
Binding,
|
||||
ProviderBuilder,
|
||||
bind,
|
||||
|
||||
Provider,
|
||||
provide
|
||||
} from './di/provider';
|
||||
export {
|
||||
ResolvedReflectiveBinding,
|
||||
ResolvedReflectiveFactory,
|
||||
ReflectiveDependency,
|
||||
|
||||
ResolvedReflectiveProvider
|
||||
} from './di/reflective_provider';
|
||||
export {ReflectiveKey} from './di/reflective_key';
|
||||
|
@ -5,6 +5,7 @@ export 'metadata.dart';
|
||||
|
||||
/**
|
||||
* {@link InjectMetadata}.
|
||||
* @stable
|
||||
*/
|
||||
class Inject extends InjectMetadata {
|
||||
const Inject(dynamic token) : super(token);
|
||||
@ -12,6 +13,7 @@ class Inject extends InjectMetadata {
|
||||
|
||||
/**
|
||||
* {@link OptionalMetadata}.
|
||||
* @stable
|
||||
*/
|
||||
class Optional extends OptionalMetadata {
|
||||
const Optional() : super();
|
||||
@ -19,6 +21,7 @@ class Optional extends OptionalMetadata {
|
||||
|
||||
/**
|
||||
* {@link InjectableMetadata}.
|
||||
* @stable
|
||||
*/
|
||||
class Injectable extends InjectableMetadata {
|
||||
const Injectable() : super();
|
||||
@ -26,6 +29,7 @@ class Injectable extends InjectableMetadata {
|
||||
|
||||
/**
|
||||
* {@link SelfMetadata}.
|
||||
* @stable
|
||||
*/
|
||||
class Self extends SelfMetadata {
|
||||
const Self() : super();
|
||||
@ -33,6 +37,7 @@ class Self extends SelfMetadata {
|
||||
|
||||
/**
|
||||
* {@link HostMetadata}.
|
||||
* @stable
|
||||
*/
|
||||
class Host extends HostMetadata {
|
||||
const Host() : super();
|
||||
@ -40,6 +45,7 @@ class Host extends HostMetadata {
|
||||
|
||||
/**
|
||||
* {@link SkipSelfMetadata}.
|
||||
* @stable
|
||||
*/
|
||||
class SkipSelf extends SkipSelfMetadata {
|
||||
const SkipSelf() : super();
|
||||
|
@ -10,6 +10,7 @@ import {makeDecorator, makeParamDecorator} from '../util/decorators';
|
||||
|
||||
/**
|
||||
* Factory for creating {@link InjectMetadata}.
|
||||
* @stable
|
||||
*/
|
||||
export interface InjectMetadataFactory {
|
||||
(token: any): any;
|
||||
@ -18,6 +19,7 @@ export interface InjectMetadataFactory {
|
||||
|
||||
/**
|
||||
* Factory for creating {@link OptionalMetadata}.
|
||||
* @stable
|
||||
*/
|
||||
export interface OptionalMetadataFactory {
|
||||
(): any;
|
||||
@ -26,6 +28,7 @@ export interface OptionalMetadataFactory {
|
||||
|
||||
/**
|
||||
* Factory for creating {@link InjectableMetadata}.
|
||||
* @stable
|
||||
*/
|
||||
export interface InjectableMetadataFactory {
|
||||
(): any;
|
||||
@ -34,6 +37,7 @@ export interface InjectableMetadataFactory {
|
||||
|
||||
/**
|
||||
* Factory for creating {@link SelfMetadata}.
|
||||
* @stable
|
||||
*/
|
||||
export interface SelfMetadataFactory {
|
||||
(): any;
|
||||
@ -42,6 +46,7 @@ export interface SelfMetadataFactory {
|
||||
|
||||
/**
|
||||
* Factory for creating {@link HostMetadata}.
|
||||
* @stable
|
||||
*/
|
||||
export interface HostMetadataFactory {
|
||||
(): any;
|
||||
@ -50,6 +55,7 @@ export interface HostMetadataFactory {
|
||||
|
||||
/**
|
||||
* Factory for creating {@link SkipSelfMetadata}.
|
||||
* @stable
|
||||
*/
|
||||
export interface SkipSelfMetadataFactory {
|
||||
(): any;
|
||||
@ -58,31 +64,37 @@ export interface SkipSelfMetadataFactory {
|
||||
|
||||
/**
|
||||
* Factory for creating {@link InjectMetadata}.
|
||||
* @stable
|
||||
*/
|
||||
export var Inject: InjectMetadataFactory = makeParamDecorator(InjectMetadata);
|
||||
|
||||
/**
|
||||
* Factory for creating {@link OptionalMetadata}.
|
||||
* @stable
|
||||
*/
|
||||
export var Optional: OptionalMetadataFactory = makeParamDecorator(OptionalMetadata);
|
||||
|
||||
/**
|
||||
* Factory for creating {@link InjectableMetadata}.
|
||||
* @stable
|
||||
*/
|
||||
export var Injectable: InjectableMetadataFactory =
|
||||
<InjectableMetadataFactory>makeDecorator(InjectableMetadata);
|
||||
|
||||
/**
|
||||
* Factory for creating {@link SelfMetadata}.
|
||||
* @stable
|
||||
*/
|
||||
export var Self: SelfMetadataFactory = makeParamDecorator(SelfMetadata);
|
||||
|
||||
/**
|
||||
* Factory for creating {@link HostMetadata}.
|
||||
* @stable
|
||||
*/
|
||||
export var Host: HostMetadataFactory = makeParamDecorator(HostMetadata);
|
||||
|
||||
/**
|
||||
* Factory for creating {@link SkipSelfMetadata}.
|
||||
* @stable
|
||||
*/
|
||||
export var SkipSelf: SkipSelfMetadataFactory = makeParamDecorator(SkipSelfMetadata);
|
||||
|
@ -19,6 +19,7 @@ export interface ForwardRefFn { (): any; }
|
||||
*
|
||||
* ### Example
|
||||
* {@example core/di/ts/forward_ref/forward_ref.ts region='forward_ref'}
|
||||
* @experimental
|
||||
*/
|
||||
export function forwardRef(forwardRefFn: ForwardRefFn): Type {
|
||||
(<any>forwardRefFn).__forward_ref__ = forwardRef;
|
||||
@ -40,6 +41,7 @@ export function forwardRef(forwardRefFn: ForwardRefFn): Type {
|
||||
* ```
|
||||
*
|
||||
* See: {@link forwardRef}
|
||||
* @experimental
|
||||
*/
|
||||
export function resolveForwardRef(type: any): any {
|
||||
if (isFunction(type) && type.hasOwnProperty('__forward_ref__') &&
|
||||
|
@ -3,6 +3,9 @@ import {unimplemented} from '../../src/facade/exceptions';
|
||||
const _THROW_IF_NOT_FOUND = /*@ts2dart_const*/ new Object();
|
||||
export const THROW_IF_NOT_FOUND = /*@ts2dart_const*/ _THROW_IF_NOT_FOUND;
|
||||
|
||||
/**
|
||||
* @stable
|
||||
*/
|
||||
export abstract class Injector {
|
||||
static THROW_IF_NOT_FOUND = _THROW_IF_NOT_FOUND;
|
||||
|
||||
|
@ -40,6 +40,7 @@ import {stringify} from '../../src/facade/lang';
|
||||
* expect(injector.get(Car).engine instanceof Engine).toBe(true);
|
||||
* ```
|
||||
* @ts2dart_const
|
||||
* @stable
|
||||
*/
|
||||
export class InjectMetadata {
|
||||
constructor(public token) {}
|
||||
@ -67,6 +68,7 @@ export class InjectMetadata {
|
||||
* expect(injector.get(Car).engine).toBeNull();
|
||||
* ```
|
||||
* @ts2dart_const
|
||||
* @stable
|
||||
*/
|
||||
export class OptionalMetadata {
|
||||
toString(): string { return `@Optional()`; }
|
||||
@ -76,6 +78,7 @@ export class OptionalMetadata {
|
||||
* `DependencyMetadata` is used by the framework to extend DI.
|
||||
* This is internal to Angular and should not be used directly.
|
||||
* @ts2dart_const
|
||||
* @stable
|
||||
*/
|
||||
export class DependencyMetadata {
|
||||
get token() { return null; }
|
||||
@ -112,6 +115,7 @@ export class DependencyMetadata {
|
||||
* expect(() => injector.get(NeedsService)).toThrowError();
|
||||
* ```
|
||||
* @ts2dart_const
|
||||
* @stable
|
||||
*/
|
||||
export class InjectableMetadata {
|
||||
constructor() {}
|
||||
@ -144,6 +148,7 @@ export class InjectableMetadata {
|
||||
* expect(() => child.get(NeedsDependency)).toThrowError();
|
||||
* ```
|
||||
* @ts2dart_const
|
||||
* @stable
|
||||
*/
|
||||
export class SelfMetadata {
|
||||
toString(): string { return `@Self()`; }
|
||||
@ -174,6 +179,7 @@ export class SelfMetadata {
|
||||
* expect(() => inj.get(NeedsDependency)).toThrowError();
|
||||
* ```
|
||||
* @ts2dart_const
|
||||
* @stable
|
||||
*/
|
||||
export class SkipSelfMetadata {
|
||||
toString(): string { return `@SkipSelf()`; }
|
||||
@ -233,6 +239,7 @@ export class SkipSelfMetadata {
|
||||
* bootstrap(App);
|
||||
*```
|
||||
* @ts2dart_const
|
||||
* @stable
|
||||
*/
|
||||
export class HostMetadata {
|
||||
toString(): string { return `@Host()`; }
|
||||
|
@ -19,6 +19,7 @@
|
||||
* Using an `OpaqueToken` is preferable to using an `Object` as tokens because it provides better
|
||||
* error messages.
|
||||
* @ts2dart_const
|
||||
* @stable
|
||||
*/
|
||||
export class OpaqueToken {
|
||||
constructor(private _desc: string) {}
|
||||
|
@ -16,6 +16,7 @@ import {BaseException} from '../../src/facade/exceptions';
|
||||
* expect(injector.get("message")).toEqual('Hello');
|
||||
* ```
|
||||
* @ts2dart_const
|
||||
* @deprecated
|
||||
*/
|
||||
export class Provider {
|
||||
/**
|
||||
@ -259,6 +260,7 @@ export function bind(token): ProviderBuilder {
|
||||
|
||||
/**
|
||||
* Helper class for the {@link bind} function.
|
||||
* @deprecated
|
||||
*/
|
||||
export class ProviderBuilder {
|
||||
constructor(public token) {}
|
||||
@ -384,6 +386,7 @@ export class ProviderBuilder {
|
||||
* See {@link Provider} for more details.
|
||||
*
|
||||
* <!-- TODO: improve the docs -->
|
||||
* @deprecated
|
||||
*/
|
||||
export function provide(token, {useClass, useValue, useExisting, useFactory, deps, multi}: {
|
||||
useClass?: Type,
|
||||
|
@ -30,6 +30,7 @@ function constructResolvingPath(keys: any[]): string {
|
||||
|
||||
/**
|
||||
* Base class for all errors arising from misconfigured providers.
|
||||
* @stable
|
||||
*/
|
||||
export class AbstractProviderError extends BaseException {
|
||||
/** @internal */
|
||||
@ -75,6 +76,7 @@ export class AbstractProviderError extends BaseException {
|
||||
*
|
||||
* expect(() => Injector.resolveAndCreate([A])).toThrowError();
|
||||
* ```
|
||||
* @stable
|
||||
*/
|
||||
export class NoProviderError extends AbstractProviderError {
|
||||
constructor(injector: ReflectiveInjector, key: ReflectiveKey) {
|
||||
@ -100,6 +102,7 @@ export class NoProviderError extends AbstractProviderError {
|
||||
* ```
|
||||
*
|
||||
* Retrieving `A` or `B` throws a `CyclicDependencyError` as the graph above cannot be constructed.
|
||||
* @stable
|
||||
*/
|
||||
export class CyclicDependencyError extends AbstractProviderError {
|
||||
constructor(injector: ReflectiveInjector, key: ReflectiveKey) {
|
||||
@ -134,6 +137,7 @@ export class CyclicDependencyError extends AbstractProviderError {
|
||||
* expect(e.originalStack).toBeDefined();
|
||||
* }
|
||||
* ```
|
||||
* @stable
|
||||
*/
|
||||
export class InstantiationError extends WrappedException {
|
||||
/** @internal */
|
||||
@ -172,6 +176,7 @@ export class InstantiationError extends WrappedException {
|
||||
* ```typescript
|
||||
* expect(() => Injector.resolveAndCreate(["not a type"])).toThrowError();
|
||||
* ```
|
||||
* @stable
|
||||
*/
|
||||
export class InvalidProviderError extends BaseException {
|
||||
constructor(provider) {
|
||||
@ -206,6 +211,7 @@ export class InvalidProviderError extends BaseException {
|
||||
*
|
||||
* expect(() => Injector.resolveAndCreate([A,B])).toThrowError();
|
||||
* ```
|
||||
* @stable
|
||||
*/
|
||||
export class NoAnnotationError extends BaseException {
|
||||
constructor(typeOrFunc, params: any[][]) {
|
||||
@ -241,6 +247,7 @@ export class NoAnnotationError extends BaseException {
|
||||
*
|
||||
* expect(() => injector.getAt(100)).toThrowError();
|
||||
* ```
|
||||
* @stable
|
||||
*/
|
||||
export class OutOfBoundsError extends BaseException {
|
||||
constructor(index) { super(`Index ${index} is out-of-bounds.`); }
|
||||
|
@ -448,6 +448,7 @@ export abstract class ReflectiveInjector implements Injector {
|
||||
* var injector = ReflectiveInjector.fromResolvedProviders(providers);
|
||||
* expect(injector.get(Car) instanceof Car).toBe(true);
|
||||
* ```
|
||||
* @experimental
|
||||
*/
|
||||
static fromResolvedProviders(providers: ResolvedReflectiveProvider[],
|
||||
parent: Injector = null): ReflectiveInjector {
|
||||
|
@ -16,6 +16,7 @@ import {resolveForwardRef} from './forward_ref';
|
||||
* `Key` should not be created directly. {@link ReflectiveInjector} creates keys automatically when
|
||||
* resolving
|
||||
* providers.
|
||||
* @experimental
|
||||
*/
|
||||
export class ReflectiveKey {
|
||||
/**
|
||||
|
@ -88,6 +88,7 @@ export class ResolvedReflectiveProvider_ implements ResolvedReflectiveBinding {
|
||||
|
||||
/**
|
||||
* An internal resolved representation of a factory function created by resolving {@link Provider}.
|
||||
* @experimental
|
||||
*/
|
||||
export class ResolvedReflectiveFactory {
|
||||
constructor(
|
||||
|
@ -13,6 +13,7 @@ import {Injector} from '../di/injector';
|
||||
* `ComponentRef` provides access to the Component Instance as well other objects related to this
|
||||
* Component Instance and allows you to destroy the Component Instance via the {@link #destroy}
|
||||
* method.
|
||||
* @stable
|
||||
*/
|
||||
export abstract class ComponentRef<C> {
|
||||
/**
|
||||
@ -69,9 +70,12 @@ export class ComponentRef_<C> extends ComponentRef<C> {
|
||||
onDestroy(callback: Function): void { this.hostView.onDestroy(callback); }
|
||||
}
|
||||
|
||||
const EMPTY_CONTEXT = /*@ts2dart_const*/ new Object();
|
||||
|
||||
/*@ts2dart_const*/
|
||||
/**
|
||||
* @experimental
|
||||
* @ts2dart_const
|
||||
*/
|
||||
const EMPTY_CONTEXT = /*@ts2dart_const*/ new Object();
|
||||
export class ComponentFactory<C> {
|
||||
constructor(public selector: string, private _viewFactory: Function,
|
||||
private _componentType: Type) {}
|
||||
|
@ -8,6 +8,7 @@ import {Injectable} from '../di/decorators';
|
||||
/**
|
||||
* Low-level service for loading {@link ComponentFactory}s, which
|
||||
* can later be used to create and render a Component instance.
|
||||
* @experimental
|
||||
*/
|
||||
export abstract class ComponentResolver {
|
||||
abstract resolveComponent(component: Type|string): Promise<ComponentFactory<any>>;
|
||||
|
@ -26,6 +26,7 @@ export class ElementRef {
|
||||
* web worker.
|
||||
* </p>
|
||||
* </div>
|
||||
* @stable
|
||||
*/
|
||||
public nativeElement: any;
|
||||
|
||||
|
@ -32,6 +32,7 @@ import {BaseException, WrappedException} from '../../src/facade/exceptions';
|
||||
* }
|
||||
* }
|
||||
* ```
|
||||
* @stable
|
||||
*/
|
||||
export class ExpressionChangedAfterItHasBeenCheckedException extends BaseException {
|
||||
constructor(oldValue: any, currValue: any, context: any) {
|
||||
@ -45,6 +46,7 @@ export class ExpressionChangedAfterItHasBeenCheckedException extends BaseExcepti
|
||||
*
|
||||
* This error wraps the original exception to attach additional contextual information that can
|
||||
* be useful for debugging.
|
||||
* @stable
|
||||
*/
|
||||
export class ViewWrappedException extends WrappedException {
|
||||
constructor(originalException: any, originalStack: any, context: any) {
|
||||
@ -58,6 +60,7 @@ export class ViewWrappedException extends WrappedException {
|
||||
* This error indicates a bug in the framework.
|
||||
*
|
||||
* This is an internal Angular error.
|
||||
* @stable
|
||||
*/
|
||||
export class ViewDestroyedException extends BaseException {
|
||||
constructor(details: string) { super(`Attempt to use a destroyed view: ${details}`); }
|
||||
|
@ -26,6 +26,7 @@ import {Observable, EventEmitter} from '../../src/facade/async';
|
||||
* }
|
||||
* }
|
||||
* ```
|
||||
* @deprecated
|
||||
*/
|
||||
export class QueryList<T> {
|
||||
private _dirty = true;
|
||||
|
@ -4,6 +4,7 @@ import { ComponentFactory } from './component_factory';
|
||||
|
||||
/**
|
||||
* Component resolver that can load components lazily
|
||||
* @experimental
|
||||
*/
|
||||
export class SystemJsComponentResolver implements ComponentResolver {
|
||||
constructor(private _resolver: ComponentResolver) {}
|
||||
|
@ -17,6 +17,7 @@ const EMPTY_CONTEXT = /*@ts2dart_const*/ new Object();
|
||||
* To instantiate Embedded Views based on a Template, use
|
||||
* {@link ViewContainerRef#createEmbeddedView}, which will create the View and attach it to the
|
||||
* View Container.
|
||||
* @stable
|
||||
*/
|
||||
export abstract class TemplateRef<C> {
|
||||
/**
|
||||
|
@ -27,6 +27,7 @@ import {ComponentFactory, ComponentRef} from './component_factory';
|
||||
*
|
||||
* To access a `ViewContainerRef` of an Element, you can either place a {@link Directive} injected
|
||||
* with `ViewContainerRef` on the Element, or you obtain it via a {@link ViewChild} query.
|
||||
* @stable
|
||||
*/
|
||||
export abstract class ViewContainerRef {
|
||||
/**
|
||||
|
@ -3,6 +3,9 @@ import {ChangeDetectorRef} from '../change_detection/change_detector_ref';
|
||||
import {AppView} from './view';
|
||||
import {ChangeDetectionStrategy} from '../change_detection/constants';
|
||||
|
||||
/**
|
||||
* @stable
|
||||
*/
|
||||
export abstract class ViewRef {
|
||||
get destroyed(): boolean { return <boolean>unimplemented(); }
|
||||
|
||||
@ -61,6 +64,7 @@ export abstract class ViewRef {
|
||||
* </ul>
|
||||
* <!-- /ViewRef: outer-0 -->
|
||||
* ```
|
||||
* @experimental
|
||||
*/
|
||||
export abstract class EmbeddedViewRef<C> extends ViewRef {
|
||||
get context(): C { return unimplemented(); }
|
||||
|
@ -22,6 +22,7 @@ export './metadata/lifecycle_hooks.dart' show
|
||||
|
||||
/**
|
||||
* See: [DirectiveMetadata] for docs.
|
||||
* @stable
|
||||
*/
|
||||
class Directive extends DirectiveMetadata {
|
||||
const Directive(
|
||||
@ -50,6 +51,7 @@ class Directive extends DirectiveMetadata {
|
||||
|
||||
/**
|
||||
* See: [ComponentMetadata] for docs.
|
||||
* @stable
|
||||
*/
|
||||
class Component extends ComponentMetadata {
|
||||
const Component(
|
||||
@ -100,6 +102,7 @@ class Component extends ComponentMetadata {
|
||||
|
||||
/**
|
||||
* See: [ViewMetadata] for docs.
|
||||
* @deprecated
|
||||
*/
|
||||
class View extends ViewMetadata {
|
||||
const View(
|
||||
@ -124,6 +127,7 @@ class View extends ViewMetadata {
|
||||
|
||||
/**
|
||||
* See: [PipeMetadata] for docs.
|
||||
* @stable
|
||||
*/
|
||||
class Pipe extends PipeMetadata {
|
||||
const Pipe({name, pure}) : super(name: name, pure: pure);
|
||||
@ -131,6 +135,7 @@ class Pipe extends PipeMetadata {
|
||||
|
||||
/**
|
||||
* See: [AttributeMetadata] for docs.
|
||||
* @stable
|
||||
*/
|
||||
class Attribute extends AttributeMetadata {
|
||||
const Attribute(String attributeName) : super(attributeName);
|
||||
@ -138,8 +143,8 @@ class Attribute extends AttributeMetadata {
|
||||
|
||||
/**
|
||||
* See: [QueryMetadata] for docs.
|
||||
* @deprecated Use ContentChildren/ContentChild instead
|
||||
*/
|
||||
@Deprecated("Use ContentChildren/ContentChild instead")
|
||||
class Query extends QueryMetadata {
|
||||
const Query(dynamic /*Type | string*/ selector,
|
||||
{bool descendants: false, dynamic read: null})
|
||||
@ -148,6 +153,7 @@ class Query extends QueryMetadata {
|
||||
|
||||
/**
|
||||
* See: [ContentChildrenMetadata] for docs.
|
||||
* @stable
|
||||
*/
|
||||
class ContentChildren extends ContentChildrenMetadata {
|
||||
const ContentChildren(dynamic /*Type | string*/ selector,
|
||||
@ -157,6 +163,7 @@ class ContentChildren extends ContentChildrenMetadata {
|
||||
|
||||
/**
|
||||
* See: [ContentChildMetadata] for docs.
|
||||
* @stable
|
||||
*/
|
||||
class ContentChild extends ContentChildMetadata {
|
||||
const ContentChild(dynamic /*Type | string*/ selector, {dynamic read: null}) : super(selector, read: read);
|
||||
@ -164,8 +171,8 @@ class ContentChild extends ContentChildMetadata {
|
||||
|
||||
/**
|
||||
* See: [ViewQueryMetadata] for docs.
|
||||
* @deprecated Use ViewChildren/ViewChild instead
|
||||
*/
|
||||
@Deprecated("Use ViewChildren/ViewChild instead")
|
||||
class ViewQuery extends ViewQueryMetadata {
|
||||
const ViewQuery(dynamic /*Type | string*/ selector, {dynamic read: null})
|
||||
: super(selector, descendants: true, read: read);
|
||||
@ -173,6 +180,7 @@ class ViewQuery extends ViewQueryMetadata {
|
||||
|
||||
/**
|
||||
* See: [ViewChildrenMetadata] for docs.
|
||||
* @stable
|
||||
*/
|
||||
class ViewChildren extends ViewChildrenMetadata {
|
||||
const ViewChildren(dynamic /*Type | string*/ selector, {dynamic read: null}) : super(selector, read: read);
|
||||
@ -180,6 +188,7 @@ class ViewChildren extends ViewChildrenMetadata {
|
||||
|
||||
/**
|
||||
* See: [ViewChildMetadata] for docs.
|
||||
* @stable
|
||||
*/
|
||||
class ViewChild extends ViewChildMetadata {
|
||||
const ViewChild(dynamic /*Type | string*/ selector, {dynamic read: null}) : super(selector, read: read);
|
||||
@ -187,6 +196,7 @@ class ViewChild extends ViewChildMetadata {
|
||||
|
||||
/**
|
||||
* See: [InputMetadata] for docs.
|
||||
* @stable
|
||||
*/
|
||||
class Input extends InputMetadata {
|
||||
const Input([String bindingPropertyName]) : super(bindingPropertyName);
|
||||
@ -194,6 +204,7 @@ class Input extends InputMetadata {
|
||||
|
||||
/**
|
||||
* See: [OutputMetadata] for docs.
|
||||
* @stable
|
||||
*/
|
||||
class Output extends OutputMetadata {
|
||||
const Output([String bindingPropertyName]) : super(bindingPropertyName);
|
||||
@ -201,6 +212,7 @@ class Output extends OutputMetadata {
|
||||
|
||||
/**
|
||||
* See: [HostBindingMetadata] for docs.
|
||||
* @stable
|
||||
*/
|
||||
class HostBinding extends HostBindingMetadata {
|
||||
const HostBinding([String hostPropertyName]) : super(hostPropertyName);
|
||||
@ -208,6 +220,7 @@ class HostBinding extends HostBindingMetadata {
|
||||
|
||||
/**
|
||||
* See: [HostListenerMetadata] for docs.
|
||||
* @stable
|
||||
*/
|
||||
class HostListener extends HostListenerMetadata {
|
||||
const HostListener(String eventName, [List<String> args])
|
||||
|
@ -397,6 +397,7 @@ export interface AttributeMetadataFactory {
|
||||
* [new ng.Query(SomeType)]
|
||||
* ]
|
||||
* ```
|
||||
* @deprecated
|
||||
*/
|
||||
export interface QueryMetadataFactory {
|
||||
(selector: Type | string,
|
||||
@ -407,6 +408,7 @@ export interface QueryMetadataFactory {
|
||||
|
||||
/**
|
||||
* Factory for {@link ContentChildren}.
|
||||
* @stable
|
||||
*/
|
||||
export interface ContentChildrenMetadataFactory {
|
||||
(selector: Type | string, {descendants, read}?: {descendants?: boolean, read?: any}): any;
|
||||
@ -416,6 +418,7 @@ export interface ContentChildrenMetadataFactory {
|
||||
|
||||
/**
|
||||
* Factory for {@link ContentChild}.
|
||||
* @stable
|
||||
*/
|
||||
export interface ContentChildMetadataFactory {
|
||||
(selector: Type | string, {read}?: {read?: any}): any;
|
||||
@ -424,6 +427,7 @@ export interface ContentChildMetadataFactory {
|
||||
|
||||
/**
|
||||
* Factory for {@link ViewChildren}.
|
||||
* @stable
|
||||
*/
|
||||
export interface ViewChildrenMetadataFactory {
|
||||
(selector: Type | string, {read}?: {read?: any}): any;
|
||||
@ -432,6 +436,7 @@ export interface ViewChildrenMetadataFactory {
|
||||
|
||||
/**
|
||||
* Factory for {@link ViewChild}.
|
||||
* @stable
|
||||
*/
|
||||
export interface ViewChildMetadataFactory {
|
||||
(selector: Type | string, {read}?: {read?: any}): any;
|
||||
@ -445,6 +450,7 @@ export interface ViewChildMetadataFactory {
|
||||
* ### Example
|
||||
*
|
||||
* {@example core/ts/metadata/metadata.ts region='pipe'}
|
||||
* @stable
|
||||
*/
|
||||
export interface PipeMetadataFactory {
|
||||
(obj: {name: string, pure?: boolean}): any;
|
||||
@ -455,6 +461,7 @@ export interface PipeMetadataFactory {
|
||||
* {@link InputMetadata} factory for creating decorators.
|
||||
*
|
||||
* See {@link InputMetadata}.
|
||||
* @stable
|
||||
*/
|
||||
export interface InputMetadataFactory {
|
||||
(bindingPropertyName?: string): any;
|
||||
@ -465,6 +472,7 @@ export interface InputMetadataFactory {
|
||||
* {@link OutputMetadata} factory for creating decorators.
|
||||
*
|
||||
* See {@link OutputMetadata}.
|
||||
* @stable
|
||||
*/
|
||||
export interface OutputMetadataFactory {
|
||||
(bindingPropertyName?: string): any;
|
||||
@ -473,6 +481,7 @@ export interface OutputMetadataFactory {
|
||||
|
||||
/**
|
||||
* {@link HostBindingMetadata} factory function.
|
||||
* @stable
|
||||
*/
|
||||
export interface HostBindingMetadataFactory {
|
||||
(hostPropertyName?: string): any;
|
||||
@ -481,6 +490,7 @@ export interface HostBindingMetadataFactory {
|
||||
|
||||
/**
|
||||
* {@link HostListenerMetadata} factory function.
|
||||
* @stable
|
||||
*/
|
||||
export interface HostListenerMetadataFactory {
|
||||
(eventName: string, args?: string[]): any;
|
||||
@ -510,6 +520,7 @@ export interface HostListenerMetadataFactory {
|
||||
* ### Example
|
||||
*
|
||||
* {@example core/ts/metadata/metadata.ts region='component'}
|
||||
* @stable
|
||||
*/
|
||||
export var Component: ComponentMetadataFactory =
|
||||
<ComponentMetadataFactory>makeDecorator(ComponentMetadata, (fn: any) => fn.View = View);
|
||||
@ -892,6 +903,7 @@ export var Component: ComponentMetadataFactory =
|
||||
* Note also that although the `<li></li>` template still exists inside the `<template></template>`,
|
||||
* the instantiated
|
||||
* view occurs on the second `<li></li>` which is a sibling to the `<template>` element.
|
||||
* @stable
|
||||
*/
|
||||
export var Directive: DirectiveMetadataFactory =
|
||||
<DirectiveMetadataFactory>makeDecorator(DirectiveMetadata);
|
||||
@ -925,6 +937,7 @@ export var Directive: DirectiveMetadataFactory =
|
||||
* }
|
||||
* }
|
||||
* ```
|
||||
* @deprecated
|
||||
*/
|
||||
var View: ViewMetadataFactory =
|
||||
<ViewMetadataFactory>makeDecorator(ViewMetadata, (fn: any) => fn.View = View);
|
||||
@ -945,6 +958,7 @@ var View: ViewMetadataFactory =
|
||||
* A decorator can inject string literal `text` like so:
|
||||
*
|
||||
* {@example core/ts/metadata/metadata.ts region='attributeMetadata'}
|
||||
* @stable
|
||||
*/
|
||||
export var Attribute: AttributeMetadataFactory = makeParamDecorator(AttributeMetadata);
|
||||
|
||||
@ -1055,6 +1069,7 @@ export var Attribute: AttributeMetadataFactory = makeParamDecorator(AttributeMet
|
||||
*
|
||||
* The injected object is an unmodifiable live list.
|
||||
* See {@link QueryList} for more details.
|
||||
* @deprecated
|
||||
*/
|
||||
export var Query: QueryMetadataFactory = makeParamDecorator(QueryMetadata);
|
||||
|
||||
@ -1078,6 +1093,7 @@ export var Query: QueryMetadataFactory = makeParamDecorator(QueryMetadata);
|
||||
* }
|
||||
* }
|
||||
* ```
|
||||
* @stable
|
||||
*/
|
||||
export var ContentChildren: ContentChildrenMetadataFactory =
|
||||
makePropDecorator(ContentChildrenMetadata);
|
||||
@ -1111,6 +1127,7 @@ export var ContentChildren: ContentChildrenMetadataFactory =
|
||||
* <item>b</item>
|
||||
* </container>
|
||||
* ```
|
||||
* @stable
|
||||
*/
|
||||
export var ContentChild: ContentChildMetadataFactory = makePropDecorator(ContentChildMetadata);
|
||||
|
||||
@ -1193,6 +1210,7 @@ export var ContentChild: ContentChildMetadataFactory = makePropDecorator(Content
|
||||
* ```
|
||||
*
|
||||
* See also: [ViewChildrenMetadata]
|
||||
* @stable
|
||||
*/
|
||||
export var ViewChildren: ViewChildrenMetadataFactory = makePropDecorator(ViewChildrenMetadata);
|
||||
|
||||
@ -1266,6 +1284,7 @@ export var ViewChildren: ViewChildrenMetadataFactory = makePropDecorator(ViewChi
|
||||
* }
|
||||
* ```
|
||||
* See also: [ViewChildMetadata]
|
||||
* @stable
|
||||
*/
|
||||
export var ViewChild: ViewChildMetadataFactory = makePropDecorator(ViewChildMetadata);
|
||||
|
||||
@ -1304,6 +1323,7 @@ export var ViewChild: ViewChildMetadataFactory = makePropDecorator(ViewChildMeta
|
||||
*
|
||||
* The injected object is an iterable and observable live list.
|
||||
* See {@link QueryList} for more details.
|
||||
* @deprecated
|
||||
*/
|
||||
export var ViewQuery: QueryMetadataFactory = makeParamDecorator(ViewQueryMetadata);
|
||||
|
||||
@ -1314,6 +1334,7 @@ export var ViewQuery: QueryMetadataFactory = makeParamDecorator(ViewQueryMetadat
|
||||
* ### Example
|
||||
*
|
||||
* {@example core/ts/metadata/metadata.ts region='pipe'}
|
||||
* @stable
|
||||
*/
|
||||
export var Pipe: PipeMetadataFactory = <PipeMetadataFactory>makeDecorator(PipeMetadata);
|
||||
|
||||
@ -1358,6 +1379,7 @@ export var Pipe: PipeMetadataFactory = <PipeMetadataFactory>makeDecorator(PipeMe
|
||||
*
|
||||
* bootstrap(App);
|
||||
* ```
|
||||
* @stable
|
||||
*/
|
||||
export var Input: InputMetadataFactory = makePropDecorator(InputMetadata);
|
||||
|
||||
@ -1402,6 +1424,7 @@ export var Input: InputMetadataFactory = makePropDecorator(InputMetadata);
|
||||
* }
|
||||
* bootstrap(App);
|
||||
* ```
|
||||
* @stable
|
||||
*/
|
||||
export var Output: OutputMetadataFactory = makePropDecorator(OutputMetadata);
|
||||
|
||||
@ -1440,6 +1463,7 @@ export var Output: OutputMetadataFactory = makePropDecorator(OutputMetadata);
|
||||
*
|
||||
* bootstrap(App);
|
||||
* ```
|
||||
* @stable
|
||||
*/
|
||||
export var HostBinding: HostBindingMetadataFactory = makePropDecorator(HostBindingMetadata);
|
||||
|
||||
@ -1477,5 +1501,6 @@ export var HostBinding: HostBindingMetadataFactory = makePropDecorator(HostBindi
|
||||
*
|
||||
* bootstrap(App);
|
||||
* ```
|
||||
* @stable
|
||||
*/
|
||||
export var HostListener: HostListenerMetadataFactory = makePropDecorator(HostListenerMetadata);
|
||||
|
@ -19,6 +19,7 @@ import {resolveForwardRef} from '../di/forward_ref';
|
||||
*
|
||||
* {@example core/ts/metadata/metadata.ts region='attributeMetadata'}
|
||||
* @ts2dart_const
|
||||
* @stable
|
||||
*/
|
||||
export class AttributeMetadata extends DependencyMetadata {
|
||||
constructor(public attributeName: string) { super(); }
|
||||
@ -141,6 +142,7 @@ export class AttributeMetadata extends DependencyMetadata {
|
||||
* The injected object is an unmodifiable live list.
|
||||
* See {@link QueryList} for more details.
|
||||
* @ts2dart_const
|
||||
* @deprecated
|
||||
*/
|
||||
export class QueryMetadata extends DependencyMetadata {
|
||||
/**
|
||||
@ -208,6 +210,7 @@ export class QueryMetadata extends DependencyMetadata {
|
||||
* }
|
||||
* ```
|
||||
* @ts2dart_const
|
||||
* @stable
|
||||
*/
|
||||
export class ContentChildrenMetadata extends QueryMetadata {
|
||||
constructor(_selector: Type | string,
|
||||
@ -237,6 +240,7 @@ export class ContentChildrenMetadata extends QueryMetadata {
|
||||
* }
|
||||
* ```
|
||||
* @ts2dart_const
|
||||
* @stable
|
||||
*/
|
||||
export class ContentChildMetadata extends QueryMetadata {
|
||||
constructor(_selector: Type | string, {read = null}: {read?: any} = {}) {
|
||||
@ -279,6 +283,7 @@ export class ContentChildMetadata extends QueryMetadata {
|
||||
* The injected object is an iterable and observable live list.
|
||||
* See {@link QueryList} for more details.
|
||||
* @ts2dart_const
|
||||
* @deprecated
|
||||
*/
|
||||
export class ViewQueryMetadata extends QueryMetadata {
|
||||
constructor(_selector: Type | string,
|
||||
@ -371,6 +376,7 @@ export class ViewQueryMetadata extends QueryMetadata {
|
||||
* }
|
||||
* ```
|
||||
* @ts2dart_const
|
||||
* @stable
|
||||
*/
|
||||
export class ViewChildrenMetadata extends ViewQueryMetadata {
|
||||
constructor(_selector: Type | string, {read = null}: {read?: any} = {}) {
|
||||
@ -448,6 +454,7 @@ export class ViewChildrenMetadata extends ViewQueryMetadata {
|
||||
* }
|
||||
* ```
|
||||
* @ts2dart_const
|
||||
* @stable
|
||||
*/
|
||||
export class ViewChildMetadata extends ViewQueryMetadata {
|
||||
constructor(_selector: Type | string, {read = null}: {read?: any} = {}) {
|
||||
|
@ -382,6 +382,7 @@ import {AnimationEntryMetadata} from '../animation/metadata';
|
||||
* the instantiated
|
||||
* view occurs on the second `<li></li>` which is a sibling to the `<template>` element.
|
||||
* @ts2dart_const
|
||||
* @stable
|
||||
*/
|
||||
export class DirectiveMetadata extends InjectableMetadata {
|
||||
/**
|
||||
@ -789,6 +790,7 @@ export class DirectiveMetadata extends InjectableMetadata {
|
||||
*
|
||||
* {@example core/ts/metadata/metadata.ts region='component'}
|
||||
* @ts2dart_const
|
||||
* @stable
|
||||
*/
|
||||
export class ComponentMetadata extends DirectiveMetadata {
|
||||
/**
|
||||
@ -943,6 +945,7 @@ export class ComponentMetadata extends DirectiveMetadata {
|
||||
*
|
||||
* {@example core/ts/metadata/metadata.ts region='pipe'}
|
||||
* @ts2dart_const
|
||||
* @stable
|
||||
*/
|
||||
export class PipeMetadata extends InjectableMetadata {
|
||||
name: string;
|
||||
@ -999,6 +1002,7 @@ export class PipeMetadata extends InjectableMetadata {
|
||||
* bootstrap(App);
|
||||
* ```
|
||||
* @ts2dart_const
|
||||
* @stable
|
||||
*/
|
||||
export class InputMetadata {
|
||||
constructor(
|
||||
@ -1049,6 +1053,7 @@ export class InputMetadata {
|
||||
* bootstrap(App);
|
||||
* ```
|
||||
* @ts2dart_const
|
||||
* @stable
|
||||
*/
|
||||
export class OutputMetadata {
|
||||
constructor(public bindingPropertyName?: string) {}
|
||||
@ -1089,6 +1094,7 @@ export class OutputMetadata {
|
||||
* bootstrap(App);
|
||||
* ```
|
||||
* @ts2dart_const
|
||||
* @stable
|
||||
*/
|
||||
export class HostBindingMetadata {
|
||||
constructor(public hostPropertyName?: string) {}
|
||||
@ -1128,6 +1134,7 @@ export class HostBindingMetadata {
|
||||
* bootstrap(App);
|
||||
* ```
|
||||
* @ts2dart_const
|
||||
* @stable
|
||||
*/
|
||||
export class HostListenerMetadata {
|
||||
constructor(public eventName: string, public args?: string[]) {}
|
||||
|
@ -1,5 +1,8 @@
|
||||
import {SimpleChange} from '../change_detection/change_detection_util';
|
||||
|
||||
/**
|
||||
* @stable
|
||||
*/
|
||||
export enum LifecycleHooks {
|
||||
OnInit,
|
||||
OnDestroy,
|
||||
@ -14,6 +17,7 @@ export enum LifecycleHooks {
|
||||
/**
|
||||
* A `changes` object whose keys are property names and
|
||||
* values are instances of {@link SimpleChange}. See {@link OnChanges}
|
||||
* @stable
|
||||
*/
|
||||
export interface SimpleChanges {[propName: string]: SimpleChange}
|
||||
|
||||
@ -77,6 +81,7 @@ export var LIFECYCLE_HOOKS_VALUES = [
|
||||
*
|
||||
* bootstrap(App).catch(err => console.error(err));
|
||||
* ```
|
||||
* @stable
|
||||
*/
|
||||
export abstract class OnChanges { abstract ngOnChanges(changes: SimpleChanges); }
|
||||
|
||||
@ -120,6 +125,7 @@ export abstract class OnChanges { abstract ngOnChanges(changes: SimpleChanges);
|
||||
*
|
||||
* bootstrap(App).catch(err => console.error(err));
|
||||
* ```
|
||||
* @stable
|
||||
*/
|
||||
export abstract class OnInit { abstract ngOnInit(); }
|
||||
|
||||
@ -187,6 +193,7 @@ export abstract class OnInit { abstract ngOnInit(); }
|
||||
* list = [];
|
||||
* }
|
||||
* ```
|
||||
* @stable
|
||||
*/
|
||||
export abstract class DoCheck { abstract ngDoCheck(); }
|
||||
|
||||
@ -278,6 +285,7 @@ export abstract class DoCheck { abstract ngDoCheck(); }
|
||||
* Invoking `{{ 10000 | countdown }}` would cause the value to be decremented by 50,
|
||||
* every 50ms, until it reaches 0.
|
||||
*
|
||||
* @stable
|
||||
*/
|
||||
export abstract class OnDestroy { abstract ngOnDestroy(); }
|
||||
|
||||
@ -331,6 +339,7 @@ export abstract class OnDestroy { abstract ngOnDestroy(); }
|
||||
*
|
||||
* bootstrap(App).catch(err => console.error(err));
|
||||
* ```
|
||||
* @stable
|
||||
*/
|
||||
export abstract class AfterContentInit { abstract ngAfterContentInit(); }
|
||||
|
||||
@ -379,6 +388,7 @@ export abstract class AfterContentInit { abstract ngAfterContentInit(); }
|
||||
*
|
||||
* bootstrap(App).catch(err => console.error(err));
|
||||
* ```
|
||||
* @stable
|
||||
*/
|
||||
export abstract class AfterContentChecked { abstract ngAfterContentChecked(); }
|
||||
|
||||
@ -426,6 +436,7 @@ export abstract class AfterContentChecked { abstract ngAfterContentChecked(); }
|
||||
*
|
||||
* bootstrap(App).catch(err => console.error(err));
|
||||
* ```
|
||||
* @stable
|
||||
*/
|
||||
export abstract class AfterViewInit { abstract ngAfterViewInit(); }
|
||||
|
||||
@ -476,5 +487,6 @@ export abstract class AfterViewInit { abstract ngAfterViewInit(); }
|
||||
*
|
||||
* bootstrap(App).catch(err => console.error(err));
|
||||
* ```
|
||||
* @stable
|
||||
*/
|
||||
export abstract class AfterViewChecked { abstract ngAfterViewChecked(); }
|
||||
|
@ -5,6 +5,7 @@ import {AnimationEntryMetadata} from '../animation/metadata';
|
||||
* Defines template and style encapsulation options available for Component's {@link View}.
|
||||
*
|
||||
* See {@link ViewMetadata#encapsulation}.
|
||||
* @stable
|
||||
*/
|
||||
export enum ViewEncapsulation {
|
||||
/**
|
||||
|
@ -14,6 +14,7 @@ var __unused: Type; // prevent missing use Dart warning.
|
||||
|
||||
/**
|
||||
* A default set of providers which should be included in any Angular platform.
|
||||
* @experimental
|
||||
*/
|
||||
export const PLATFORM_COMMON_PROVIDERS: Array<any | Type | Provider | any[]> = /*@ts2dart_const*/[
|
||||
PLATFORM_CORE_PROVIDERS,
|
||||
|
@ -23,6 +23,7 @@ import {OpaqueToken} from './di';
|
||||
*
|
||||
* bootstrap(MyComponent, [provide(PLATFORM_DIRECTIVES, {useValue: [OtherDirective], multi:true})]);
|
||||
* ```
|
||||
* @stable
|
||||
*/
|
||||
export const PLATFORM_DIRECTIVES: OpaqueToken =
|
||||
/*@ts2dart_const*/ new OpaqueToken("Platform Directives");
|
||||
@ -49,5 +50,6 @@ export const PLATFORM_DIRECTIVES: OpaqueToken =
|
||||
*
|
||||
* bootstrap(MyComponent, [provide(PLATFORM_PIPES, {useValue: [OtherPipe], multi:true})]);
|
||||
* ```
|
||||
* @stable
|
||||
*/
|
||||
export const PLATFORM_PIPES: OpaqueToken = /*@ts2dart_const*/ new OpaqueToken("Platform Pipes");
|
||||
|
@ -41,6 +41,7 @@ function noopScope(arg0?: any, arg1?: any): any {
|
||||
* needs to be fixed before the app should be profiled. Add try-finally only when you expect that
|
||||
* an exception is expected during normal execution while profiling.
|
||||
*
|
||||
* @experimental
|
||||
*/
|
||||
export var wtfCreateScope: (signature: string, flags?: any) => impl.WtfScopeFn =
|
||||
wtfEnabled ? impl.createScope : (signature: string, flags?: any) => noopScope;
|
||||
@ -52,6 +53,7 @@ export var wtfCreateScope: (signature: string, flags?: any) => impl.WtfScopeFn =
|
||||
* - `returnValue` (optional) to be passed to the WTF.
|
||||
*
|
||||
* Returns the `returnValue for easy chaining.
|
||||
* @experimental
|
||||
*/
|
||||
export var wtfLeave:<T>(scope: any, returnValue?: T) => T =
|
||||
wtfEnabled ? impl.leave : (s: any, r?: any) => r;
|
||||
@ -67,6 +69,7 @@ export var wtfLeave:<T>(scope: any, returnValue?: T) => T =
|
||||
* wtfEndTimeRange(s);
|
||||
* });
|
||||
* }
|
||||
* @experimental
|
||||
*/
|
||||
export var wtfStartTimeRange: (rangeType: string, action: string) => any =
|
||||
wtfEnabled ? impl.startTimeRange : (rangeType: string, action: string) => null;
|
||||
@ -75,6 +78,7 @@ export var wtfStartTimeRange: (rangeType: string, action: string) => any =
|
||||
* Ends a async time range operation.
|
||||
* [range] is the return value from [wtfStartTimeRange] Async ranges only work if WTF has been
|
||||
* enabled.
|
||||
* @experimental
|
||||
*/
|
||||
export var wtfEndTimeRange: (range: any) => void = wtfEnabled ? impl.endTimeRange : (r: any) =>
|
||||
null;
|
||||
|
@ -5,6 +5,9 @@ import {AnimationKeyframe} from '../../src/animation/animation_keyframe';
|
||||
import {AnimationPlayer} from '../../src/animation/animation_player';
|
||||
import {AnimationStyles} from '../../src/animation/animation_styles';
|
||||
|
||||
/**
|
||||
* @experimental
|
||||
*/
|
||||
export class RenderComponentType {
|
||||
constructor(public id: string, public templateUrl: string, public slotCount: number,
|
||||
public encapsulation: ViewEncapsulation, public styles: Array<string | any[]>) {}
|
||||
@ -19,6 +22,9 @@ export abstract class RenderDebugInfo {
|
||||
get source(): string { return unimplemented(); }
|
||||
}
|
||||
|
||||
/**
|
||||
* @experimental
|
||||
*/
|
||||
export abstract class Renderer {
|
||||
abstract selectRootElement(selectorOrNode: string | any, debugInfo: RenderDebugInfo): any;
|
||||
|
||||
@ -77,8 +83,8 @@ export abstract class Renderer {
|
||||
* If you are implementing a custom renderer, you must implement this interface.
|
||||
*
|
||||
* The default Renderer implementation is `DomRenderer`. Also available is `WebWorkerRenderer`.
|
||||
* @experimental
|
||||
*/
|
||||
|
||||
export abstract class RootRenderer {
|
||||
abstract renderComponent(componentType: RenderComponentType): Renderer;
|
||||
}
|
||||
|
@ -10,6 +10,7 @@ import {Injectable} from '../di/decorators';
|
||||
* The Testability service provides testing hooks that can be accessed from
|
||||
* the browser and by services such as Protractor. Each bootstrapped Angular
|
||||
* application on the page will have an instance of Testability.
|
||||
* @experimental
|
||||
*/
|
||||
@Injectable()
|
||||
export class Testability {
|
||||
@ -101,6 +102,7 @@ export class Testability {
|
||||
|
||||
/**
|
||||
* A global registry of {@link Testability} instances for specific elements.
|
||||
* @experimental
|
||||
*/
|
||||
@Injectable()
|
||||
export class TestabilityRegistry {
|
||||
@ -145,6 +147,7 @@ class _NoopGetTestability implements GetTestability {
|
||||
|
||||
/**
|
||||
* Set the {@link GetTestability} implementation used by the Angular testing framework.
|
||||
* @experimental
|
||||
*/
|
||||
export function setTestabilityGetter(getter: GetTestability): void {
|
||||
_testabilityGetter = getter;
|
||||
|
@ -206,6 +206,7 @@ function applyParams(fnOrArray: (Function | any[]), key: string): Function {
|
||||
* }
|
||||
* });
|
||||
* ```
|
||||
* @stable
|
||||
*/
|
||||
export function Class(clsDef: ClassDefinition): ConcreteType {
|
||||
var constructor = applyParams(
|
||||
|
@ -74,6 +74,7 @@ export {NgZoneError} from './ng_zone_impl';
|
||||
* }
|
||||
* }
|
||||
* ```
|
||||
* @experimental
|
||||
*/
|
||||
export class NgZone {
|
||||
static isInAngularZone(): boolean { return NgZoneImpl.isInAngularZone(); }
|
||||
|
@ -1,5 +1,6 @@
|
||||
/**
|
||||
* Stores error information; delivered via [NgZone.onError] stream.
|
||||
* @deprecated
|
||||
*/
|
||||
export class NgZoneError {
|
||||
constructor(public error: any, public stackTrace: any) {}
|
||||
|
Reference in New Issue
Block a user