parent
238dfc1e17
commit
fd3eae9623
@ -19,8 +19,7 @@ import {
|
|||||||
NoBindingError,
|
NoBindingError,
|
||||||
AbstractBindingError,
|
AbstractBindingError,
|
||||||
CyclicDependencyError,
|
CyclicDependencyError,
|
||||||
resolveForwardRef,
|
resolveForwardRef
|
||||||
DependencyProvider
|
|
||||||
} from 'angular2/src/core/di';
|
} from 'angular2/src/core/di';
|
||||||
import {
|
import {
|
||||||
UNDEFINED,
|
UNDEFINED,
|
||||||
@ -28,7 +27,8 @@ import {
|
|||||||
Visibility,
|
Visibility,
|
||||||
InjectorInlineStrategy,
|
InjectorInlineStrategy,
|
||||||
InjectorDynamicStrategy,
|
InjectorDynamicStrategy,
|
||||||
BindingWithVisibility
|
BindingWithVisibility,
|
||||||
|
DependencyProvider
|
||||||
} from 'angular2/src/core/di/injector';
|
} from 'angular2/src/core/di/injector';
|
||||||
import {resolveBinding, ResolvedFactory} from 'angular2/src/core/di/binding';
|
import {resolveBinding, ResolvedFactory} from 'angular2/src/core/di/binding';
|
||||||
|
|
||||||
|
@ -18,7 +18,7 @@ export {
|
|||||||
export * from './di/decorators';
|
export * from './di/decorators';
|
||||||
|
|
||||||
export {forwardRef, resolveForwardRef, ForwardRefFn} from './di/forward_ref';
|
export {forwardRef, resolveForwardRef, ForwardRefFn} from './di/forward_ref';
|
||||||
export {Injector, DependencyProvider} from './di/injector';
|
export {Injector} from './di/injector';
|
||||||
export {
|
export {
|
||||||
Binding,
|
Binding,
|
||||||
BindingBuilder,
|
BindingBuilder,
|
||||||
@ -27,7 +27,7 @@ export {
|
|||||||
Dependency,
|
Dependency,
|
||||||
bind
|
bind
|
||||||
} from './di/binding';
|
} from './di/binding';
|
||||||
export {Key, KeyRegistry, TypeLiteral} from './di/key';
|
export {Key, TypeLiteral} from './di/key';
|
||||||
export {
|
export {
|
||||||
NoBindingError,
|
NoBindingError,
|
||||||
AbstractBindingError,
|
AbstractBindingError,
|
||||||
|
@ -254,6 +254,9 @@ export class Binding {
|
|||||||
* ```
|
* ```
|
||||||
*/
|
*/
|
||||||
export class ResolvedBinding {
|
export class ResolvedBinding {
|
||||||
|
/**
|
||||||
|
* @private
|
||||||
|
*/
|
||||||
constructor(
|
constructor(
|
||||||
/**
|
/**
|
||||||
* A key, usually a `Type`.
|
* A key, usually a `Type`.
|
||||||
@ -261,11 +264,13 @@ export class ResolvedBinding {
|
|||||||
public key: Key,
|
public key: Key,
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* @private
|
||||||
* Factory function which can return an instance of an object represented by a key.
|
* Factory function which can return an instance of an object represented by a key.
|
||||||
*/
|
*/
|
||||||
public resolvedFactories: ResolvedFactory[],
|
public resolvedFactories: ResolvedFactory[],
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* @private
|
||||||
* Indicates if the binding is a multi-binding or a regular binding.
|
* Indicates if the binding is a multi-binding or a regular binding.
|
||||||
*/
|
*/
|
||||||
public multiBinding: boolean) {}
|
public multiBinding: boolean) {}
|
||||||
@ -275,6 +280,7 @@ export class ResolvedBinding {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* @private
|
||||||
* An internal resolved representation of a factory function created by resolving {@link Binding}.
|
* An internal resolved representation of a factory function created by resolving {@link Binding}.
|
||||||
*/
|
*/
|
||||||
export class ResolvedFactory {
|
export class ResolvedFactory {
|
||||||
|
@ -1,5 +1,14 @@
|
|||||||
import {Type, stringify, isFunction} from 'angular2/src/core/facade/lang';
|
import {Type, stringify, isFunction} from 'angular2/src/core/facade/lang';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* An interface that a function passed into {@link forwardRef} has to implement.
|
||||||
|
*
|
||||||
|
* ### Example
|
||||||
|
*
|
||||||
|
* ```typescript
|
||||||
|
* var fn:ForwardRefFn = forwardRef(() => Lock);
|
||||||
|
* ```
|
||||||
|
*/
|
||||||
export interface ForwardRefFn { (): any; }
|
export interface ForwardRefFn { (): any; }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -74,29 +74,7 @@ export class OptionalMetadata {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* `DependencyMetadata` is used by the framework to extend DI.
|
* `DependencyMetadata` is used by the framework to extend DI.
|
||||||
*
|
* This is internal to Angular and should not be used directly.
|
||||||
* Only metadata implementing `DependencyMetadata` are added to the list of dependency
|
|
||||||
* properties.
|
|
||||||
*
|
|
||||||
* For example:
|
|
||||||
*
|
|
||||||
* ```
|
|
||||||
* class Exclude extends DependencyMetadata {}
|
|
||||||
* class NotDependencyProperty {}
|
|
||||||
*
|
|
||||||
* class AComponent {
|
|
||||||
* constructor(@Exclude @NotDependencyProperty aService:AService) {}
|
|
||||||
* }
|
|
||||||
* ```
|
|
||||||
*
|
|
||||||
* will create the following dependency:
|
|
||||||
*
|
|
||||||
* ```
|
|
||||||
* new Dependency(Key.get(AService), [new Exclude()])
|
|
||||||
* ```
|
|
||||||
*
|
|
||||||
* The framework can use `new Exclude()` to handle the `aService` dependency
|
|
||||||
* in a specific way.
|
|
||||||
*/
|
*/
|
||||||
@CONST()
|
@CONST()
|
||||||
export class DependencyMetadata {
|
export class DependencyMetadata {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user