How to get querystring at the start of application


#1

Hello,

I have developed a simple app in which the ionic2 app will be open from other website and parameter will be send via querystring. Any clue how to received that parameter ???

Thank you,
Pratik


#2

Did you find a solution for this?


#3

Yes,

import { URLSearchParams } from “@angular/http”;

let params = new URLSearchParams(window.location.search);
let someParam = params.get(‘user’);

“user” is the parameter name in query string.

try this.

Pratik


#4

thats worked for me in all ts file home.ts app.component.ts and rest.ts in provider folder i can read them all in all pages. great.