/**
 * Created with IntelliJ IDEA.
 * User: issa
 * Date: 2/10/14
 * Time: 1:18 AM
 */


app.directive('aFloat', function() {
    function link(scope, element, attrs){
        var data = scope.afData;
        var options = scope.afOption;

        var totalWidth = element.width(), totalHeight = element.height();

        if (totalHeight === 0 || totalWidth === 0) {
            throw new Error('Please set height and width for the aFloat element'+'width is '+ele);
        }

        function init(o,d){
            $.plot(element, o , d);
        }

        scope.$watch('afOption', function (o){
          init(o,data);
        });
        scope.$watch('afData', function (d){
           init(d,options);
        });

    }
    return {
        restrict: 'EA',
        template: '<div></div>',
        link: link,
        replace:true,
        transclude: false,
        scope: {
            afOption: '=',
            afData: '='
        }
    };
});
@@ -173,55 +173,84 @@
     
-var data = scope.afData;%0A        var options = 
+scope.$watch('afData + afOption', function()%7B%0A            init(scope.afData,
 scop
@@ -259,16 +259,29 @@
 afOption
+);%0A        %7D)
 ;%0A%0A     
@@ -591,178 +591,8 @@
   %7D%0A
-%0A        scope.$watch('afOption', function (o)%7B%0A          init(o,data);%0A        %7D);%0A        scope.$watch('afData', function (d)%7B%0A           init(d,options);%0A        %7D);%0A%0A
     
@@ -683,16 +683,16 @@
 : link,%0A
+
         
@@ -709,35 +709,8 @@
 ue,%0A
-        transclude: false,%0A
     

Fix scope watch of angular flotchart integration