Provides an injectable wrapper for the document
object.
Inject this in your services/components and you will be able to easily mock or spy on the native document
object in your tests.
By default, the nativeDocument
property will point to angular's DOM adapter, thus facilitating DOM access and manipulation
on the different platforms.
To mock the native document, provide a value for the DOCUMENT
token from @bespunky/angular-zen/core
.
You will safely mock it without trashing angular's DOCUMENT
provider.
See document-ref.service.spec.ts for examples.
core/src/document-ref/document-ref.service.ts
Properties |
|
constructor(nativeDocument: any)
|
||||||||
Creates an instance of
Parameters:
|
||||||||
Public Readonly nativeDocument |
Type: any
|
Decorators:
@Inject(DOCUMENT)
|
The native document provided by the `DOCUMENT` token of `@bespunky/angular-zen/core`. See `DocumentRef` for details.
|