Preliminary
queryParams, , params , , , . console.log(params);. :
url: http://example.com/?lion=10&lion=15&cat=20
, :
this.route.queryParams.subscribe((params) => {
console.log(params);
});
, lion cat, - , cat - :
{ lion: [10, 15], cat:20 }
,
url : http://example.com/?id&name=james
, id . , URL- , , , . :
if(params['id']){
}
false, . , - , - , . lodash, /. lodash . _. :
// check if id key is present in params object first
if(_.has(params, 'id')) {
if(params['id']=="") {
// id key is present but has no value so do something
} else {
// id key is present and has a value as well so do something else
}
} else {
// since id key itself is not present do something totally different here
}
, , id url. .