From d56086505cfd3e0549438b8030c5677aab7770c1 Mon Sep 17 00:00:00 2001 From: Jakob Odersky Date: Sun, 11 May 2014 13:06:59 +0200 Subject: reinstore scope for adding graph edges --- app/js/directives.js | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) (limited to 'app/js') diff --git a/app/js/directives.js b/app/js/directives.js index 3004ebd..57186f3 100644 --- a/app/js/directives.js +++ b/app/js/directives.js @@ -4,6 +4,10 @@ app.directive('pgLine', function () { return { restrict: 'A', replace: 'false', + scope: { + line: '=', + points: '@' + }, template: '', link: function (scope, elems, attrs) { var canvas = elems[0]; @@ -11,7 +15,7 @@ app.directive('pgLine', function () { mainTool.activate(); - scope.line = scope.$eval(attrs.pgLine); + //scope.line = scope.$eval(attrs.pgLine); paper.setup(canvas); @@ -61,15 +65,20 @@ app.directive('pgLine', function () { scope.$apply(); } -/* + + + scope.$watchCollection('points', function(newVal) { console.log("update"); if (newVal) { + + + paper.project.clear(); drawPoints(scope.points); } }, true); -*/ + } } -- cgit v1.2.3