In certain cases, the default implementation provided by the service might not answer the needs of your code. One such case is testing.
When testing, we sometimes need to simulate the internal workings of the native document
object.
Assuming you injected DocumentRef
into your component or service:
Notice that
DOCUMENT
is imported from@bespunky/angular-zen/core
and not from@angular/common
. Providing a value for angular's token directly might break your app/spec as angular relies on the token internally.