1
我有一個可點擊酒吧的highchart指令。我想要實現的是使用onClick清理查詢參數,然後將新的參數從圖表添加到URL。但是,當我將$ location注入到指令中時,onClick事件停止工作 - 我看到路徑已更改,但新頁面未加載。Highcharts指令如何獲取/更改當前路徑onClick事件?
這裏是代碼塊:
point:{
events:{
click: function (event) {
location.search({}); // clean up all query parameters
var path = location.absUrl() + '/sql_id=' + this.category;
location.href = path; // send me to the new url
}
}
}
謝謝!
你能嘗試注入'$ window'和使用'$ window.location'無處不在,你使用'location'? –
它工作,即使我只在一個地方添加窗口。 window.location.href = path; 非常感謝! – Petya