angular
    .module('universal')
    .controller('ConstructorController1', ['$scope', function ($scope) {
        $scope.init = function () {
            jsPlumb.bind("ready", function () {
                console.log("Set up jsPlumb listeners (should be only done once)");
                jsPlumb.bind("connection", function (info) {
                    $scope.$apply(function () {
                        console.log("Possibility to push connection into array");
                    });
                });

                jsPlumb.importDefaults({
                    Connector: ['Flowchart'],
                    Endpoint: ["Dot", { radius: 3 }]
                });

                jsPlumb.setContainer($('#container'));
            });
        }
    }]);