Sorry I’m not keen on javascript modules.
I’ve understood that my custom properties provider works because of this index.js file:
import MyCustomPropertiesProvider from "./MyCustomPropertiesProvider";
export default {
__init__: ["propertiesProvider"],
propertiesProvider: ["type", MyCustomPropertiesProvider],
};
so when I
import myCustomPropertiesProvider from "custom-properties-provider";
where “custom-properties-provider” is the folder where index.js resides, the imported object is
{ __init__: "propertiesProvider", propertiesProvider: ["type", MyCustomPropertiesProvider] }
So, I get that init is used to determine the name with which I want to request the provided module, so __init__: "fooBar"
means that I’ll write SomeModule.$inject = ["fooBar"]
.
What I don’t know (where should I look for documentation?) is how to tell the injector that I want to provide an existing instance instead of a constructor for the provided module. I mean, I want to write something like this:
{ __init__: "myCustomService", myCustomService: ["instance", _myCustomServiceInstanceFromAngular] }
Is “instance” a valid string for the injector? If not, what can I write?