Git Product home page Git Product logo

Comments (1)

defval avatar defval commented on June 19, 2024

@zeromake Hi! Thank you for your interest.

I understand your problem. But I wouldn't want the code to be unable to be used without a container. This approach creates a direct connection between the container and the package that contains such a constructor. And if you use the constructor without a container, you will get a non-working code. I would like to avoid this.
On the other hand, this is an optional feature. This does not change the normal workflow. In general, it can be merged.

As an alternative, how do you look to introduce the di.ProvideValue() with di.ResolvePublicFields() provide option (need to think about naming):

di.ProvideValue(&Controller{}, di.ResolvePublicFields()),

If di.ResolvePublicFields() is specified, the container will bypass the public properties of the type and inject dependencies in them without tags.

from di.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.