Answer the question
In order to leave comments, you need to log in
How to request a token for a class?
Banal class:
@Injectable()
export class SearchFilter {
constructor(
@Inject(SEARCH_CONFIG) private searchConfig: SearchConfig) {}
}
SEARCH_CONFIG
for a class SearchFilter
in a module? Answer the question
In order to leave comments, you need to log in
Not for the class. The token will be passed into the injector.
Injectors are created per platform, per root, per module, per directive (there is a node injector).
useFactory, useValue are already details, i.e. an indication to the injector where to get the value for this token.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question