File tree 2 files changed +7
-15
lines changed
2 files changed +7
-15
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,14 +32,12 @@ import {
32
32
StaticProvider ,
33
33
} from "@angular/core" ;
34
34
35
- // Work around a TS bug requiring an imports of
36
- // InjectionToken, ViewEncapsulation and MissingTranslationStrategy
37
- // without using them
38
- if ( ( < any > global ) . ___TS_UNUSED ) {
39
- ( ( ) => InjectionToken ) ( ) ;
40
- ( ( ) => ViewEncapsulation ) ( ) ;
41
- ( ( ) => MissingTranslationStrategy ) ( ) ;
42
- }
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
+ } ) ;
43
41
44
42
// Register DOM adapter, if possible. Dynamic platform only!
45
43
import "./dom-adapter" ;
@@ -62,7 +60,7 @@ export const NS_COMPILER_PROVIDERS: StaticProvider[] = [
62
60
} ,
63
61
{
64
62
provide : DOCUMENT ,
65
- useValue : { body : { isOverride : true } } ,
63
+ useValue : doc ,
66
64
} ,
67
65
] ;
68
66
You can’t perform that action at this time.
0 commit comments