@@ -387,6 +387,7 @@ export class BindingWithVisibility {
387387}
388388
389389/**
390+ * @private
390391 * Used to provide dependencies that cannot be easily expressed as bindings.
391392 */
392393export interface DependencyProvider {
@@ -469,9 +470,6 @@ export class Injector {
469470 * The passed-in bindings can be an array of `Type`, {@link Binding},
470471 * or a recursive array of more bindings.
471472 *
472- * The method also takes an optional {@link DependencyProvider}, which is used to
473- * resolve dependencies that cannot be expressed as bindings.
474- *
475473 * ### Example ([live demo](http://plnkr.co/edit/ePOccA?p=preview))
476474 *
477475 * ```typescript
@@ -492,20 +490,16 @@ export class Injector {
492490 * because it needs to resolve the passed-in bindings first.
493491 * See {@link resolve} and {@link fromResolvedBindings}.
494492 */
495- static resolveAndCreate ( bindings : Array < Type | Binding | any [ ] > ,
496- depProvider : DependencyProvider = null ) : Injector {
493+ static resolveAndCreate ( bindings : Array < Type | Binding | any [ ] > ) : Injector {
497494 var resolvedBindings = Injector . resolve ( bindings ) ;
498- return Injector . fromResolvedBindings ( resolvedBindings , depProvider ) ;
495+ return Injector . fromResolvedBindings ( resolvedBindings ) ;
499496 }
500497
501498 /**
502499 * Creates an injector from previously resolved bindings.
503500 *
504501 * This API is the recommended way to construct injectors in performance-sensitive parts.
505502 *
506- * The method also takes an optional {@link DependencyProvider}, which is used to
507- * resolve dependencies that cannot be expressed as bindings.
508- *
509503 * ### Example ([live demo](http://plnkr.co/edit/KrSMci?p=preview))
510504 *
511505 * ```typescript
@@ -523,12 +517,10 @@ export class Injector {
523517 * expect(injector.get(Car) instanceof Car).toBe(true);
524518 * ```
525519 */
526- static fromResolvedBindings ( bindings : ResolvedBinding [ ] ,
527- depProvider : DependencyProvider = null ) : Injector {
520+ static fromResolvedBindings ( bindings : ResolvedBinding [ ] ) : Injector {
528521 var bd = bindings . map ( b => new BindingWithVisibility ( b , Visibility . Public ) ) ;
529522 var proto = new ProtoInjector ( bd ) ;
530- var inj = new Injector ( proto , null , depProvider ) ;
531- return inj ;
523+ return new Injector ( proto , null , null ) ;
532524 }
533525
534526 _strategy : InjectorStrategy ;
@@ -539,7 +531,7 @@ export class Injector {
539531 * Private
540532 */
541533 constructor ( public _proto : any /* ProtoInjector */ , public _parent : Injector = null ,
542- private _depProvider : DependencyProvider = null ,
534+ private _depProvider : any /* DependencyProvider */ = null ,
543535 private _debugContext : Function = null ) {
544536 this . _strategy = _proto . _strategy . createInjectorStrategy ( this ) ;
545537 }
@@ -636,9 +628,6 @@ export class Injector {
636628 * The passed-in bindings can be an array of `Type`, {@link Binding},
637629 * or a recursive array of more bindings.
638630 *
639- * The methods also takes an optional {@link DependencyProvider}, which is used to
640- * resolved dependencies that cannot be expressed as bindings.
641- *
642631 * ### Example ([live demo](http://plnkr.co/edit/opB3T4?p=preview))
643632 *
644633 * ```typescript
@@ -657,10 +646,9 @@ export class Injector {
657646 * because it needs to resolve the passed-in bindings first.
658647 * See {@link resolve} and {@link createChildFromResolved}.
659648 */
660- resolveAndCreateChild ( bindings : Array < Type | Binding | any [ ] > ,
661- depProvider : DependencyProvider = null ) : Injector {
649+ resolveAndCreateChild ( bindings : Array < Type | Binding | any [ ] > ) : Injector {
662650 var resolvedBindings = Injector . resolve ( bindings ) ;
663- return this . createChildFromResolved ( resolvedBindings , depProvider ) ;
651+ return this . createChildFromResolved ( resolvedBindings ) ;
664652 }
665653
666654 /**
@@ -671,9 +659,6 @@ export class Injector {
671659 *
672660 * This API is the recommended way to construct injectors in performance-sensitive parts.
673661 *
674- * The methods also takes an optional {@link DependencyProvider}, which is used to
675- * resolved dependencies that cannot be expressed as bindings.
676- *
677662 * ### Example ([live demo](http://plnkr.co/edit/VhyfjN?p=preview))
678663 *
679664 * ```typescript
@@ -691,11 +676,10 @@ export class Injector {
691676 * expect(child.get(ParentBinding)).toBe(parent.get(ParentBinding));
692677 * ```
693678 */
694- createChildFromResolved ( bindings : ResolvedBinding [ ] ,
695- depProvider : DependencyProvider = null ) : Injector {
679+ createChildFromResolved ( bindings : ResolvedBinding [ ] ) : Injector {
696680 var bd = bindings . map ( b => new BindingWithVisibility ( b , Visibility . Public ) ) ;
697681 var proto = new ProtoInjector ( bd ) ;
698- var inj = new Injector ( proto , null , depProvider ) ;
682+ var inj = new Injector ( proto , null , null ) ;
699683 inj . _parent = this ;
700684 return inj ;
701685 }
0 commit comments