Under index.html I have delcared an external js file like
Follow below steps in your component:-
1) First add a reference of your external JS file for importing it to the component.
Import * as abcJS from '/YourExternalJS.js';
2) Now declare a "var" of the same name that your function has inside external JS.
declare var cartstack_updatecart: any;
3) ngOninit(){
cartstack_updatecart();
}
4) Do remember that your JQuery should be loaded first than your external JS file.
I have called that function on ngoninit lifecycleHook. Also instead of declaring external JS file inside Index.html, I would rather suggest you to declare it in angular-cli.json file in scripts array. All the best.