Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

281
Views
How to use external libraries for AOT in angular2?
  • Environment: Operating system: Ubuntu 16.04 , IDE: Atom

  • Angular version: 2.3.1

  • Browser: [ Chrome 57.0.2987.110 ]

  • Language: [ TypeScript 2.1.6 | ES6 ]

  • Node (for AoT issues): node --version =6.9.5

When do the scripts inside scripts tag of angular-cli.json actually get executed during AOT ?

In one of my components, I have used minified amazon s3 sdk. ('aws-sdk-2.23.0.min.js') In JIT, my app is working fine when I use

declare let AWS: any;

But in AOT it produces following error:

Cannot read property 'S3' of undefined
TypeError: Cannot read property 'S3' of undefined.

angular-cli.json contains following:

{
  ... 
  "apps": [
    {
     ....
      "scripts": [
         "aws-sdk-2.23.0.min.js"
      ]      
    }
  ]
  ...
}
about 4 years ago · Santiago Trujillo
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!