I am not sure this is the right question or the right way of doing it.
I have a service called emailService, and i want to get the config from global.php. how to achieve that.
NOTE: i used factory to inject the config container but when I call this service in a controller I am getting errors, I think i need to pass some data to EmailService from controller as I am using constructor to get the config in EmailService.
Glad I could help. Generally you should consider creating EmailService that has injected configuration and inject that service into controller (or other place where you need it)