我希望能够在点击后将参数保存在url中。
当我在离线页面上时,我有这个网址:
我希望连接后也能使用相同的一个。但是,参数不会保留。这就是连接之后:
我希望此参数(<button ng-click="$ctrl.onConnect()">connect</button>
)保持
HTML:
onConnect() {
const search = this.$location.search().src_org
if (search === '166') {
this.$location.state().search('src_org', '166')
}
}
JS:
BluetoothService
我想知道$ location是否可以解决这个问题?或者通过其他方法,但不使用ui-router或ng-route。