Use external javaScript library in angular application

前端 未结 6 425
爱一瞬间的悲伤
爱一瞬间的悲伤 2020-11-30 05:52

I have an angular 4 application and I have a javascript component that I created in a javascript file : timeline.js. The javascript component works well but I w

6条回答
  •  忘掉有多难
    2020-11-30 06:24

    you simply need to do

     import * as Timeline from '../assets/js/timeline.js';
    

    You can also do (at the top of your file) :

    declare var Timeline: any;
    

    Check also below for good practices.

提交回复
热议问题