0

I've followed below link and trying to implement file upload feature in Angular 8. https://medium.com/ramsatt/angular-7-upload-file-to-amazon-s3-bucket-ba27022bad54,

  1. npm install aws-sdk --save

    1. npm install --save-dev @types/node

    2. Need to add "types": ["node"] to the tsconfig.app.json

    3. Add below lines in polyfills.js - Not sure where can I add in polyfills.js.

    if (typeof (window as any).global === 'undefined') { (window as any).global = window; }

After adding above line I'm getting error.

[error] C:\Users\admin\source\repos\polling-app-ui2\node_modules\graceful-fs\polyfills.js:7
if (typeof (window as any).global === 'undefined') { (window as any).global = window; }

SyntaxError: (JS) **

any

type assertion expression can only be used in .ts file**

Unexpected identifier

1 Answer 1

1

It should be in polyfills.ts not in js

Sign up to request clarification or add additional context in comments.

1 Comment

This helped me - l was trying to solve this for an embarrassingly long time.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.