We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
Getting a query string from a route URI element is simple (ex: example.com/home?id=7)
import { ActivatedRoute } from '@angular/router';
... id: string | undefined; constructor(private route: ActivatedRoute) { } ngOnInit() { this.route.queryParams .subscribe(params => { this.id = params['id']; } ); ...
<ng-container *ngIf="id"> ... <app-item [itemId]="id"></app-item> <span> {{ id }} </span> ... </ng-container>