I recently attempted to dynamically add mxgraph with the client-side library angularjs, but I couldn't find any relevant documentation on how to do so. Can anyone offer guidance on integrating mxgraph, such as which files need to be included and what needs to be called from the HTML file to make it functional?
app.js var app = angular.module('app', ['mxGraph']);
mxcontroller.js:
app.controller('Ctrl', ['$scope', 'mxgraph',
function($scope, mxgraph) {
$scope.main = function(container)
{
var graph = new mxgraph(container);
var parent = graph.getDefaultParent();
graph.getModel().beginUpdate();
try
{
var v1 = graph.insertVertex(parent, null, 'Hello,', 20, 20, 80, 30);
var v2 = graph.insertVertex(parent, null, 'World!', 200, 150, 80, 30);
}
finally
{
graph.getModel().endUpdate();
}
}; }]);
index.html
has been updated to include the mxgraph javascript/src
folders.
mx.html
<div ng-controller="Ctrl as controller" id="content-container">
Thank you in advance for any assistance provided.