In my Angular 6 project, I am facing an issue with accessing a private JavaScript library that is imported in the index.html file. The functions in this library are globally scoped, but when I try to access them inside a component, Angular does not recognize them and no error is displayed.
index.html
.....
<script src="https://somefile.js type="text/javascript" charset="utf-8">
.....
// contains a function
doXYZ() within the global namespace
somecomponent.ts
......
ngOnInit() {
doXYZ() //attempting to call the globally imported function
}
......
ERROR: When using
ng serve
, 'Cannot find name doXYZ' is displayed.