parent
238dfc1e17
commit
fd3eae9623
|
@ -19,8 +19,7 @@ import {
|
|||
NoBindingError,
|
||||
AbstractBindingError,
|
||||
CyclicDependencyError,
|
||||
resolveForwardRef,
|
||||
DependencyProvider
|
||||
resolveForwardRef
|
||||
} from 'angular2/src/core/di';
|
||||
import {
|
||||
UNDEFINED,
|
||||
|
@ -28,7 +27,8 @@ import {
|
|||
Visibility,
|
||||
InjectorInlineStrategy,
|
||||
InjectorDynamicStrategy,
|
||||
BindingWithVisibility
|
||||
BindingWithVisibility,
|
||||
DependencyProvider
|
||||
} from 'angular2/src/core/di/injector';
|
||||
import {resolveBinding, ResolvedFactory} from 'angular2/src/core/di/binding';
|
||||
|
||||
|
|
|
@ -18,7 +18,7 @@ export {
|
|||
export * from './di/decorators';
|
||||
|
||||
export {forwardRef, resolveForwardRef, ForwardRefFn} from './di/forward_ref';
|
||||
export {Injector, DependencyProvider} from './di/injector';
|
||||
export {Injector} from './di/injector';
|
||||
export {
|
||||
Binding,
|
||||
BindingBuilder,
|
||||
|
@ -27,7 +27,7 @@ export {
|
|||
Dependency,
|
||||
bind
|
||||
} from './di/binding';
|
||||
export {Key, KeyRegistry, TypeLiteral} from './di/key';
|
||||
export {Key, TypeLiteral} from './di/key';
|
||||
export {
|
||||
NoBindingError,
|
||||
AbstractBindingError,
|
||||
|
|
|
@ -254,6 +254,9 @@ export class Binding {
|
|||
* ```
|
||||
*/
|
||||
export class ResolvedBinding {
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
constructor(
|
||||
/**
|
||||
* A key, usually a `Type`.
|
||||
|
@ -261,11 +264,13 @@ export class ResolvedBinding {
|
|||
public key: Key,
|
||||
|
||||
/**
|
||||
* @private
|
||||
* Factory function which can return an instance of an object represented by a key.
|
||||
*/
|
||||
public resolvedFactories: ResolvedFactory[],
|
||||
|
||||
/**
|
||||
* @private
|
||||
* Indicates if the binding is a multi-binding or a regular binding.
|
||||
*/
|
||||
public multiBinding: boolean) {}
|
||||
|
@ -275,6 +280,7 @@ export class ResolvedBinding {
|
|||
}
|
||||
|
||||
/**
|
||||
* @private
|
||||
* An internal resolved representation of a factory function created by resolving {@link Binding}.
|
||||
*/
|
||||
export class ResolvedFactory {
|
||||
|
|
|
@ -1,5 +1,14 @@
|
|||
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; }
|
||||
|
||||
/**
|
||||
|
|
|
@ -74,29 +74,7 @@ export class OptionalMetadata {
|
|||
|
||||
/**
|
||||
* `DependencyMetadata` is used by the framework to extend DI.
|
||||
*
|
||||
* 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.
|
||||
* This is internal to Angular and should not be used directly.
|
||||
*/
|
||||
@CONST()
|
||||
export class DependencyMetadata {
|
||||
|
|
Loading…
Reference in New Issue