fix(events): fixed handling of onAppEvents when used from rootScope, must supply localscope, can now be used in isolate scope scenarios

This commit is contained in:
Torkel Ödegaard
2015-09-18 12:15:06 +02:00
parent 69db9e0d45
commit 3d85e85f29
9 changed files with 20 additions and 15 deletions

View File

@@ -20,7 +20,7 @@ function (angular, _, queryDef) {
$rootScope.onAppEvent('elastic-query-updated', function() {
$scope.validateModel();
$scope.updateOrderByOptions();
});
}, $scope);
$scope.init = function() {
$scope.agg = bucketAggs[$scope.index];

View File

@@ -22,7 +22,7 @@ function (angular, _, queryDef) {
$rootScope.onAppEvent('elastic-query-updated', function() {
$scope.index = _.indexOf(metricAggs, $scope.agg);
$scope.validateModel();
});
}, $scope);
$scope.validateModel = function() {
$scope.isFirst = $scope.index === 0;