I want to import the library foxToolTip with angular.
I tried import * as foxToolTip from 'fox.tooltip.js';
but the [ts]
doesn't found the module fox.tooltip.js
I installed the version : fox.tooltip.js: 1.0.13,
I want to import the library foxToolTip with angular.
I tried import * as foxToolTip from 'fox.tooltip.js';
but the [ts]
doesn't found the module fox.tooltip.js
I installed the version : fox.tooltip.js: 1.0.13,
after installing it, please add it in .angular-cli.json
and declare it
In case of Angular 5, inside
.angular-cli.json
'sscripts
array, add the path to fox.tooltip.jsIn case of Angular 6, inside
angular.json
'sscripts
array, add the path to fox.tooltip.js without../
and then, inside your Component, just declare a variable named foxToolTip like this:
You don't need to do
as your the compiler will throw an error stating that:
Just adding the script to the scripts array in .angular-cli will add it to the global scope and you'll be able to access it from your components.
Also, make sure that you call any function on it inside the
ngAfterViewInit
lifecycle hook method as it tries to access the DOM elements by id.