You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/fragments/start/getting-started/angular/setup.mdx
+43-3Lines changed: 43 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -9,16 +9,56 @@ npx -p @angular/cli ng new amplify-app
9
9
cd amplify-app
10
10
```
11
11
12
-
### Angular 6+ Support
12
+
Angular 6+ does not include shims for 'global' or 'process'.
13
13
14
-
Angular 6+ does not include shims for 'global' or 'process' as provided in previous versions. Add the following to your `src/polyfills.ts` file to recreate them:
14
+
<BlockSwitcher>
15
+
16
+
<Blockname="Angular 15">
17
+
18
+
First, create `src/polyfills.ts` and add the following:
15
19
16
20
```javascript
17
21
(window as any).global=window;
18
22
(window as any).process= {
19
23
env: { DEBUG:undefined },
20
24
};
21
-
```
25
+
```
26
+
27
+
Then, open your `angular.json` file, and add `src/polyfills.ts` to polyfills array(s) in your `angular.json`. These arrays are located in projects.`<project-name>.architect.<task-name>.options`.
28
+
29
+
```javascript
30
+
"polyfills": [
31
+
"zone.js",
32
+
"src/polyfills.ts"
33
+
],
34
+
```
35
+
36
+
And finally, make sure to add `src/polyfills` to files in your `tsconfig.app.json`:
37
+
38
+
```javascript
39
+
{
40
+
"files": [
41
+
"src/main.ts",
42
+
"src/polyfills.ts"
43
+
],
44
+
}
45
+
```
46
+
</Block>
47
+
48
+
<Blockname="Angular 6-14">
49
+
50
+
Add the following to your `src/polyfills.ts` file to recreate them:
0 commit comments