diff --git a/client/app/components/query-link.js b/client/app/components/query-link.js index 11c995113b..307675e312 100644 --- a/client/app/components/query-link.js +++ b/client/app/components/query-link.js @@ -1,18 +1,3 @@ - -function QueryLinkController() { - let hash = null; - if (this.visualization) { - if (this.visualization.type === 'TABLE') { - // link to hard-coded table tab instead of the (hidden) visualization tab - hash = 'table'; - } else { - hash = this.visualization.id; - } - } - - this.link = this.query.getUrl(false, hash); -} - export default function init(ngModule) { ngModule.component('queryLink', { bindings: { @@ -21,12 +6,26 @@ export default function init(ngModule) { readonly: '<', }, template: ` - + {{$ctrl.query.name}} `, - controller: QueryLinkController, + controller() { + this.getUrl = () => { + let hash = null; + if (this.visualization) { + if (this.visualization.type === 'TABLE') { + // link to hard-coded table tab instead of the (hidden) visualization tab + hash = 'table'; + } else { + hash = this.visualization.id; + } + } + + return this.query.getUrl(false, hash); + }; + }, }); }