I am trying to get a URL parameter from the following URL
http://localhost:4200/#/candidate/login/?corporateid=66d8c83c-841a-42e8-945c-beb8c1af25ef&userid=cb2147ed-bd42-4b9f-82d4-0dcef861e24d&token=CfDJ8Ie7+UQ8GQRBtQNOMB6ytQXk0OvqW+/l9W1yh3gCLQw7Sa606eaQtWAC472uUrsUnMQtt69R4gF7f6aab/lIdToo9AfiwtJ7wlsdYnomPpo1OgOaIUZZVBtEaBxRfuJin/Rl+WO+AnvHAn6v4Sf2yO+2gkNotCw0yLsfgzKYOwOciVRDHWY5mNktbGsRCb96kbnxd6VyW02Vs7szuSBG4Ow5fFdtvVUkQDj+ne4HZQAyvts8pNOOkNT/g+cCbOO/wA==
The parameter value that I need is the userid but I seem to be getting a null.
Here is my code
location = window.location;
urlHref = location.href;
urlConvert = new URL(this.urlHref);
if (location.toString().includes('userid')) {
this.userId = this.urlConvert.searchParams.get("userid");
console.log(this.userId);
} else {
this.userId = 'user';
console.log('gets user not candidate');
}
Route.paramsuseridparameter