How about using an angular router?
The router keeps track of the request parameters, so they should be available on your initial '/' route
your root component may have a route that allows this
constructor(private route: ActivatedRoute) {} ngOnInit() { this.sub = this.route.params.subscribe(params => { this.flag = params['flag']; }); }
source share