The Angular docs show an example of injecting a value (configuration object) using @inject
in the constructor for the times when you aren't injecting a class.
https://angular.io/guide/dependency-injection#non-class-dependencies
I was able to get this to work, but I'm not sure I understand the point of this use-case. Because it's not a class creating instances--it's just a configuration object that's being read from, why wouldn't I just import it and read from it where I need to. I have to make an import to the class anyway even if I want to inject the value into the constructor.
Is this simply to make sure that the value is available at the time the class starts building since it's in the constructor?
I'm just not sure I'm seeing the value of the DI and feel I'm probably missing something.