I'm trying to use vis.js with AngularJS. It's working fine, I built a simple directive... But I need to use some of the events listed here, but they are not being fired.
In this example the graph.on('select', ...)
event listener is not fired, there's any problem on how I'm doing this?
Here is what I'm doing:
app.directive('visGraph', [function() {
return {
restrict: 'AE',
scope: {
data: '=data',
options: '=options'
},
link: function(scope, element, attrs) {
var container = element[0];
var graph = null;
graph = new vis.Graph(container, scope.data, scope.options);
scope.$watch(function() {
return scope.data;
}, function(value) {
graph = new vis.Graph(container, scope.data, scope.options);
});
graph.on('select', function (properties) {
console.info('select.properties.nodes', properties.nodes);
console.info('select.properties.edges', properties.edges);
});
}
};
}]);
Anyone can help?