This possibly relates to Javascript, TypeScript, or Angular 2. I'm not sure?
Here is an example:
onSearch( term:string)
{
this.router.navigate([' search', {term: term}]);
}
I don't understand what the '{term: term}' is doing?
This possibly relates to Javascript, TypeScript, or Angular 2. I'm not sure?
Here is an example:
onSearch( term:string)
{
this.router.navigate([' search', {term: term}]);
}
I don't understand what the '{term: term}' is doing?
This is how the parameters are passed via the navigate Method. It accepts object, where term is the variable name and other term is the string that needs to be passed. It would be more appropriate if you write.
this.router.navigate([' search', {'term': term}]);