1.

How to add external js file in angular 4?

Answer»

To add an external js FILE into Angular 4, follow these STEPS:

  • REFER the SCRIPTS inside the angular-cli.json file like this:
    "scripts": [ "../path" ];
  • Add this into typings.d.ts :
    declare var variableName:any;
  • Import the above onto your js file as:
    import * as variable from 'variableName';


Discussion

No Comment Found