Call external js file function in Angular js controller

后端 未结 5 1940
挽巷
挽巷 2021-02-18 20:42

I have the external js file which has more functions.

I need to call these functions from angular controller.

For example: external.js



        
5条回答
  •  走了就别回头了
    2021-02-18 21:15

    You need to create a global instance of the function.

    Add a line:

    var abc= new funcName(); at the end of the File and you can use this line (var abc= new funcName();) in your controller to invoke any methods from this file by using abc.methodName.

提交回复
热议问题