Skip to content
This repository was archived by the owner on Dec 6, 2017. It is now read-only.
This repository was archived by the owner on Dec 6, 2017. It is now read-only.

Should be able through injector instantiate a class that depends on the class being instantiated #5

Closed
@pavelgj

Description

@pavelgj
class ParentDynamicallyInstantiatingChild {
  ParentDynamicallyInstantiatingChild(Injector injector) {
    injector.get(ChildDependingOnParent);
  }
}

class ChildDependingOnParent {
  ChildDependingOnParent(ParentDynamicallyInstantiatingChild _);
}

it('should be able through injector instantiate a class that depends on the class being instantiated', () {
  var injector = new Injector();
  expect(() {
    injector.get(ParentDynamicallyInstantiatingChild);
  }, not(throwsA(anything)));
});

throws
Cannot resolve a circular dependency! (resolving ParentDynamicallyInstantiatingChild -> ChildDependingOnParent -> ParentDynamicallyInstantiatingChild)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions