In Angular 9 the injectable decorator option providedIn
has a new value called any
. What is the difference between root
and any
?
Is a service considered a singleton in the case that I use any
?
@Injectable({providedIn: 'any'})
class UsefulService {
}
any
is a super confusing name (I'm sure there was about a month long discussion on the name though!) It's easier if you readprovidedIn
in your head asprovided by which ngModule
– Simon_Weaver