From 7f82faf9236c6ebe6a500ffe4cc2acc68722d93b Mon Sep 17 00:00:00 2001 From: rennay Date: Sat, 25 Mar 2023 18:53:52 +0200 Subject: [PATCH 1/2] Update setup.mdx Hi - Update made for Angular 15 support. src/polyfill.ts does not exist. Aligning this documentation with Amplify docs - https://ui.docs.amplify.aws/angular/getting-started/troubleshooting. Regards, Rennay --- .../start/getting-started/angular/setup.mdx | 29 +++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/src/fragments/start/getting-started/angular/setup.mdx b/src/fragments/start/getting-started/angular/setup.mdx index 415b9950a70..3123e3534e6 100644 --- a/src/fragments/start/getting-started/angular/setup.mdx +++ b/src/fragments/start/getting-started/angular/setup.mdx @@ -19,6 +19,35 @@ Angular 6+ does not include shims for 'global' or 'process' as provided in previ env: { DEBUG: undefined }, }; ``` +### Angular 15 Support +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.`.architect..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" + ], +} +``` ### Internet Explorer 11 (IE11) Support: From b69e0f56ef81d6ec6d3916a03f19371bc6145436 Mon Sep 17 00:00:00 2001 From: rennay Date: Mon, 27 Mar 2023 23:29:52 +0200 Subject: [PATCH 2/2] Update using BlockSwitcher Hi - As per suggestion from @tannerabread, I have made the update using BlockSwitcher. Apologies in advance if not completed correctly. I could not confirm using Preview. Please let me know if any further update required. Again, aligning to https://ui.docs.amplify.aws/angular/getting-started/troubleshooting. Regards, Rennay --- .../start/getting-started/angular/setup.mdx | 29 +++++++++++++------ 1 file changed, 20 insertions(+), 9 deletions(-) diff --git a/src/fragments/start/getting-started/angular/setup.mdx b/src/fragments/start/getting-started/angular/setup.mdx index 3123e3534e6..b2b58a804ea 100644 --- a/src/fragments/start/getting-started/angular/setup.mdx +++ b/src/fragments/start/getting-started/angular/setup.mdx @@ -9,17 +9,12 @@ 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: + + + -```javascript -(window as any).global = window; -(window as any).process = { - env: { DEBUG: undefined }, -}; -``` -### Angular 15 Support First, create `src/polyfills.ts` and add the following: ```javascript @@ -48,6 +43,22 @@ And finally, make sure to add `src/polyfills` to files in your `tsconfig.app.jso ], } ``` + + + + +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 }, +}; +``` + + + + ### Internet Explorer 11 (IE11) Support: