Skip to content

Commit 5260331

Browse files
authored
fix: add polyfils to ng templates (#196)
1 parent e33ba0e commit 5260331

File tree

4 files changed

+44
-4
lines changed

4 files changed

+44
-4
lines changed
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
/**
2+
* NativeScript Polyfills
3+
*/
4+
5+
// Install @nativescript/core polyfills (XHR, setTimeout, requestAnimationFrame)
6+
import '@nativescript/core/globals';
7+
// Install @nativescript/angular specific polyfills
8+
import '@nativescript/angular/polyfills';
9+
10+
/**
11+
* Zone.js and patches
12+
*/
13+
// Add pre-zone.js patches needed for the NativeScript platform
14+
import '@nativescript/zone-js/dist/pre-zone-polyfills';
15+
16+
// Zone JS is required by default for Angular itself
17+
import 'zone.js';
18+
19+
// Add NativeScript specific Zone JS patches
20+
import '@nativescript/zone-js';

packages/template-drawer-navigation-ng/tsconfig.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,6 @@
1616
}
1717
},
1818
"include": ["./src/**/*.ios.ts", "./src/**/*.android.ts"],
19-
"files": ["./src/main.ts", "./references.d.ts"],
19+
"files": ["./src/main.ts", "./references.d.ts", "./src/polyfills.ts"],
2020
"exclude": ["node_modules", "platforms"]
2121
}
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
/**
2+
* NativeScript Polyfills
3+
*/
4+
5+
// Install @nativescript/core polyfills (XHR, setTimeout, requestAnimationFrame)
6+
import '@nativescript/core/globals';
7+
// Install @nativescript/angular specific polyfills
8+
import '@nativescript/angular/polyfills';
9+
10+
/**
11+
* Zone.js and patches
12+
*/
13+
// Add pre-zone.js patches needed for the NativeScript platform
14+
import '@nativescript/zone-js/dist/pre-zone-polyfills';
15+
16+
// Zone JS is required by default for Angular itself
17+
import 'zone.js';
18+
19+
// Add NativeScript specific Zone JS patches
20+
import '@nativescript/zone-js';

packages/template-tab-navigation-ng/tsconfig.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
"@/*": ["src/*"]
1616
}
1717
},
18-
"include": ["src/**/*.android.ts", "src/**/*.ios.ts"],
19-
"files": ["./src/main.ts", "./references.d.ts"],
20-
"exclude": ["node_modules", "platforms", "e2e"]
18+
"include": ["./src/**/*.ios.ts", "./src/**/*.android.ts"],
19+
"files": ["./src/main.ts", "./references.d.ts", "./src/polyfills.ts"],
20+
"exclude": ["node_modules", "platforms"]
2121
}

0 commit comments

Comments
 (0)