in .ts file
private queryParams:string ='';
ngOnInit() {
this.route.queryParams.subscribe(params => {
this.queryParams= params['PARAMETER_NAME'];
});
}
**For "PARAMETER_NAME" you can mention the name of the query parameter.
For example if route is "/userId"
this.queryParams= params['userId'];
in .html file
<div *ngIf="queryParams.toLowerCase() === 'QUERY_NAME'.toLowerCase()"></div>
**For "QUERY_NAME" you can mention the intended query parameter string.
For example if intended string is "userName"
<div *ngIf="queryParams.toLowerCase() === 'userName'.toLowerCase()"></div>