Hi.
Currently I'm trying to call a function from an external JS-lib. (tooltip.js)
I managed to load the JS-File via
twx.app.fn.loadResourceScript('Uploaded/tooltip.js');
as mentioned here
https://community.ptc.com/t5/Vuforia-Studio/Including-js-file-from-resources/m-p/556781#M3480
But unfortunately I'm getting an ReferenceError: Tooltip is not defined.
My function in home.js looks like this:
//Tooltips $scope.createTooltips = function(){ var referenceElement = document.querySelectorAll('[widget-id="photoBtn"]'); const instance = new Tooltip(referenceElement, { title: "Hey there", trigger: "click", }); instance.show(); }
the function(variable) I want to use from external js (tooltip.js) looks like this.
var Tooltip = function () { function Tooltip(reference, options) { ...some code.... }
Someone has an idea?
Solved! Go to Solution.
My mistake.
I just saw that I load the JS-files after the model was initialised.
That's to late.
Now it's working.
Thanks!
Hello feil Marble,
Best regards,
Samuel
My mistake.
I just saw that I load the JS-files after the model was initialised.
That's to late.
Now it's working.
Thanks!