Im using this:
import { HttpParams } from '@angular/common/http';
let params = new HttpParams();
params.append('newOrdNum','123');
But this is not working, i dont append param in url. Any suggestion?
Im using this:
import { HttpParams } from '@angular/common/http';
let params = new HttpParams();
params.append('newOrdNum','123');
But this is not working, i dont append param in url. Any suggestion?
On
You should use Router module. check this doc: https://angular.io/guide/router
You need import these modules:
import { Router, ActivatedRoute, ParamMap } from '@angular/router';
On
I had to adjust Jota.Toledos answer a bit so that it works for me, I had to take out the second and the last property of the extras - object:
navigateToFoo(){
this._router.navigate([], {
queryParams: {
newOrdNum: '123'
},
queryParamsHandling: 'merge',
});
}
This could be achieved by using the
Routerclass:Using a component:
For more info check this book and the angular Router API