Commit 540436e9 by Mitsuhiro Tanda

inject templateSrv

parent 490141da
......@@ -23,7 +23,7 @@ function (angular, _, moment, dateMath, CloudWatchAnnotationQuery) {
var queries = [];
options = angular.copy(options);
options.targets = this.expandTemplateVariable(options.targets);
options.targets = this.expandTemplateVariable(options.targets, templateSrv);
_.each(options.targets, function(target) {
if (target.hide || !target.namespace || !target.metricName || _.isEmpty(target.statistics)) {
return;
......@@ -338,7 +338,7 @@ function (angular, _, moment, dateMath, CloudWatchAnnotationQuery) {
});
}
this.expandTemplateVariable = function(targets) {
this.expandTemplateVariable = function(targets, templateSrv) {
return _.chain(targets)
.map(function(target) {
var dimensionKey = null;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment