I am trying to add class on the tap of the node in cytoscape.js. Here is the link for the complete code:
https://stackblitz.com/edit/angular-kpnys1?file=src%2Fapp%2Fapp.component.ts
ngViewAfterInit function
cy.on("tap", "node", function(evt) {
var node = evt.target;
console.log("tapped " + node.id());
cy.nodes(node).classes("foo");
});
Tap works fine but it does not add any class to the node. Is that possible?