useFactory takes a factory function that is expected to return the value and also can have dependencies (require instances of other providers passed as parameter)
The provide property configures the token that will be used in dependency injection and the useFactory is pointing to the function that will be used to return the desired value. The deps property configures the tokens that will be passed to your factory function.
https://offering.solutions/blog/articles/2018/08/17/using-useclass-usefactory-usevalue-useexisting-with-treeshakable-providers-in-angular/
useFactory
takes a factory function that is expected to return the value and also can have dependencies (require instances of other providers passed as parameter)The
provide
property configures the token that will be used in dependency injection and theuseFactory
is pointing to the function that will be used to return the desired value. Thedeps
property configures the tokens that will be passed to your factory function.