How do i send parameters in GET call using angular 2 I tried in the following way, but getting some error saying,
Argument of type '{ params: URLSearchParams; }' is not assignable to parameter of type 'RequestOptionsArgs'.
Object literal may only specify known properties, and 'params' does not exist in type 'RequestOptionsArgs'.
function call:
import {Http, Response, Headers, RequestOptions, URLSearchParams} from 'angular2/http';
import 'rxjs/Rx';
constructor(private nav: NavController, public http: Http) {
onLogin(value: string): void {
if(this.authForm.valid) {
this.userData.login();
let params = '';
let options = new RequestOptions({
// Have to make a URLSearchParams with a query string
params: new URLSearchParams('validateUsr=false')
});
this.http.get('https://itunes.apple.com/us/rss/topmovies/limit=1/json', options)
.map(res => res.json())
.subscribe(
data => {},
err => this.logError(err),
() => this.validateUser()
);
this.nav.push(AccountViewPage);
}
}
Need to pass the parameres like this,
params: {
validateUsr: "false"
}