user3194721
user3194721

Reputation: 815

How to upload file with AWS S3 - Angular 8

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

Upvotes: 0

Views: 630

Answers (1)

user3194721
user3194721

Reputation: 815

It should be in polyfills.ts not in js

Upvotes: 1

Related Questions