diff --git a/src/fragments/start/getting-started/angular/setup.mdx b/src/fragments/start/getting-started/angular/setup.mdx index 415b9950a70..b2b58a804ea 100644 --- a/src/fragments/start/getting-started/angular/setup.mdx +++ b/src/fragments/start/getting-started/angular/setup.mdx @@ -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: + + + + +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" + ], +} +``` + + + + +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: