diff --git a/src/app/controllers/dashLoader.js b/src/app/controllers/dashLoader.js index 720c4634628..837674c9112 100644 --- a/src/app/controllers/dashLoader.js +++ b/src/app/controllers/dashLoader.js @@ -22,6 +22,17 @@ function (angular, _, moment, config) { $scope.onAppEvent('zoom-out', function() { $scope.zoom(2); }); + + var count = 0; + $scope.$watch(function() { + console.log(1); + count++; + }, function(n, o) { + }); + + setTimeout(function() { + console.log("Total count:" + count); + }, 4000); }; $scope.set_default = function() { diff --git a/src/app/directives/grafanaSimplePanel.js b/src/app/directives/grafanaSimplePanel.js index 69481cd38dc..72b218ab893 100644 --- a/src/app/directives/grafanaSimplePanel.js +++ b/src/app/directives/grafanaSimplePanel.js @@ -60,18 +60,8 @@ function (angular, _) { loadController(name); }); - if(attr.panel) { - $scope.$watch(attr.panel, function (panel) { - // If the panel attribute is specified, create a new scope. This ruins configuration - // so don't do it with anything that needs to use editor.html - if(!_.isUndefined(panel)) { - $scope = $scope.$new(); - $scope.panel = angular.fromJson(panel); - } - }); - } } }; }); -}); \ No newline at end of file +}); diff --git a/src/app/panels/text/module.js b/src/app/panels/text/module.js index 26430e85020..60abc9a3186 100644 --- a/src/app/panels/text/module.js +++ b/src/app/panels/text/module.js @@ -88,7 +88,7 @@ function (angular, app, _, require) { } if(!$scope.$$phase) { - $scope.$apply(); + $scope.$digest(); } };