在angularJS中,如何在不调用$routeProvider的情况下更改url参数



我使用angularJS和$routeProvider作为路由页面,如何在不调用routeProvider和刷新页面的情况下更改url参数。我想在不检查$routeProvider和recall&刷新

您可以跳过angular并使用历史api。

if (history.pushState) {
var url = window.location.protocol + "//" + window.location.host + window.location.pathname + '?changedValue=2';
window.history.pushState({path:url},'',url);
}

相关内容

最新更新