I'm encountering the error message Uncaught TypeError: qtip.$domEle.qtip is not a function
when trying to create a qtip tooltip for a cytoscape node in an AngularJS directive.
My code looks like this:
function graphDirective() {
return {
restrict: 'E',
templateUrl: 'app/graph/graph.html',
link() {
const cytoscape = require('cytoscape');
const jquery = require('jquery');
const cyqtip = require('cytoscape-qtip');
cyqtip(cytoscape, jquery);
const cy = cytoscape({
container: document.querySelector('graph #cy')
});
cy.add({
nodes: [
{
data: {
id: 'test'
}
}
]
});
cy.$('#test').qtip({
content: 'Hello!'
style: {
classes: 'qtip-bootstrap'
});
}
};
}
export default graphDirective;
I have already gone through this quite similar thread, but as jQuery is required via CommonJS before cytoscape.js-qtip, this solution does not fit too well.
Does anyone know how to fix this? Thank you in advance.
Edit: Fixed typing error in code example.