Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 43 additions & 3 deletions src/fragments/start/getting-started/angular/setup.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,56 @@ npx -p @angular/cli ng new amplify-app
cd amplify-app
```

### Angular 6+ Support
Angular 6+ does not include shims for 'global' or 'process'.

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:
<BlockSwitcher>

<Block name="Angular 15">

First, create `src/polyfills.ts` and add the following:

```javascript
(window as any).global = window;
(window as any).process = {
env: { DEBUG: undefined },
};
```
```

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`.

```javascript
"polyfills": [
"zone.js",
"src/polyfills.ts"
],
```

And finally, make sure to add `src/polyfills` to files in your `tsconfig.app.json`:

```javascript
{
"files": [
"src/main.ts",
"src/polyfills.ts"
],
}
```
</Block>

<Block name="Angular 6-14">

Add the following to your `src/polyfills.ts` file to recreate them:

```javascript
(window as any).global = window;
(window as any).process = {
env: { DEBUG: undefined },
};
```

</Block>

</BlockSwitcher>

### Internet Explorer 11 (IE11) Support:

Expand Down