// var openid = $state.params.openid; var paramsArr = location.href.match(/\?\S+/)[0].replace('?', '').split('&'); vm.params = {}; for (var i = 0; i < ...
// var openid = $state.params.openid;
var paramsArr = location.href.match(/\?\S+/)[0].replace('?', '').split('&');
vm.params = {};
for (var i = 0; i < paramsArr.length; i++) {
var tmp = paramsArr[i].split('=');
vm.params[tmp[0]] = tmp[1];
}