This has been fixed by using the templateSrv service instead, and its getVariables method.
Edit: Actually it seems templateSrv.getVariables() is not available in v6.0.2, but templateSrv.variables is available in both v6.0.2 and v7.4.2.
This has been fixed by using the templateSrv service instead, and its getVariables method.
Edit: Actually it seems templateSrv.getVariables() is not available in v6.0.2, but templateSrv.variables is available in both v6.0.2 and v7.4.2.