0

I have some problem on getting parameter from query string. I'm trying using

import { URLSearchParams } from '@angular/http';

this.params = new URLSearchParams(window.location.search); this.params1 = this.params.getAll('param'); console.log('parameter: '+JSON.stringify(this.params1))

and when I'm try to access http://localhost:8100/param=1 it getting error Cannot GET /param=1

How can I get that param?

1 Answer 1

1

Okay, i'm try using this.platform.getQueryParam('param'); and it working fine.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.