You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When building a panel you should use the replaceVariables function instead of using the templateSrv directly. The main reason for this is to get proper support for template variabels when repeating the panel based on a template variable.
We should add an example show casing this along side of documentation highlighting what additional scenarios the panel will support by using this function.
For more information see the following PR and issue.
@mckn iirc 2 of our examples use replaceVariables, 1 uses templateSrv. Is this just to update the one which uses templateSrv or are there other changes we should make.
In terms of documentation, again it would be good to expand upon where you're thinking for this and where a user would have first thought to use templateSrv as that user journey is unclear to me at this point
@mckn iirc 2 of our examples use replaceVariables, 1 uses templateSrv. Is this just to update the one which uses templateSrv or are there other changes we should make.
In terms of documentation, again it would be good to expand upon where you're thinking for this and where a user would have first thought to use templateSrv as that user journey is unclear to me at this point
Yupp, agree about the docs! The example using templateSrv is a data source and in that context it should be ok to use the templateSrv.
When building a panel you should use the
replaceVariables
function instead of using thetemplateSrv
directly. The main reason for this is to get proper support for template variabels when repeating the panel based on a template variable.We should add an example show casing this along side of documentation highlighting what additional scenarios the panel will support by using this function.
For more information see the following PR and issue.
grafana/grafana-iot-twinmaker-app#188
The text was updated successfully, but these errors were encountered: