young-steveo / bottlejs

A powerful dependency injection micro container for JavaScript applications
MIT License
1.29k stars 67 forks source link

Run time dependency resolve #123

Closed sreeram180 closed 5 years ago

sreeram180 commented 5 years ago

how to do run time dependency resolve for provider/service, where function arguments can be assign before creating the instance of a service

var bottle = new Bottle();

function modalcomponent($modalinstace,$modaldata,someservice){
 //code
}
bottle.service("modalcomponent",modalcomponent,"modalinstace","$modaldata","someservice");

$modalinstace, $modadata will be change based component/controller.

For example AngualrJs UI $uimodal controller function, where you can resolve controller argument during the run time.

young-steveo commented 5 years ago

Hi, @sreeram180, sorry for taking so long to get back to you; this issue flew under my radar for some reason.

I'm not sure I understand the scope of the question. Are you asking how to inject something from angular into your service?

young-steveo commented 5 years ago

Closing for now; mention me in a comment if you're still having trouble.