File tree 2 files changed +8
-7
lines changed
2 files changed +8
-7
lines changed Original file line number Diff line number Diff line change @@ -18,12 +18,6 @@ import { NativeScriptModule } from "../nativescript.module";
18
18
import { NativeScriptRendererFactory } from "../renderer" ;
19
19
import { NativeScriptAnimationDriver } from "./animation-driver" ;
20
20
21
- ( < any > global ) . document = {
22
- body : {
23
- isOverride : true ,
24
- }
25
- } ;
26
-
27
21
@Injectable ( )
28
22
export class InjectableAnimationEngine extends AnimationEngine {
29
23
constructor ( driver : AnimationDriver , normalizer : AnimationStyleNormalizer ) {
Original file line number Diff line number Diff line change @@ -32,6 +32,13 @@ import {
32
32
StaticProvider ,
33
33
} from "@angular/core" ;
34
34
35
+ // Add a fake polyfill for the document object
36
+ ( < any > global ) . document = ( < any > global ) . document || { } ;
37
+ const doc = ( < any > global ) . document ;
38
+ doc . body = Object . assign ( ( doc . body || { } ) , {
39
+ isOverride : true ,
40
+ } ) ;
41
+
35
42
// Work around a TS bug requiring an imports of
36
43
// InjectionToken, ViewEncapsulation and MissingTranslationStrategy
37
44
// without using them
@@ -62,7 +69,7 @@ export const NS_COMPILER_PROVIDERS: StaticProvider[] = [
62
69
} ,
63
70
{
64
71
provide : DOCUMENT ,
65
- useValue : { body : { isOverride : true } } ,
72
+ useValue : doc ,
66
73
} ,
67
74
] ;
68
75
You can’t perform that action at this time.
0 commit comments