Cómo pasar parámetros de consulta con un routerLink en el nuevo Router V 3 alpha (vladivostok)
Quiero pasar un parámetro de consulta prop=xxx
.
Esto no funcionó
<a [routerLink]="['/somepath', {queryParams: {prop: 'xxx'}}]>Somewhere</a>
58
Author: Gurwinder Singh, 2016-06-17
1 answers
queryParams
queryParams
es otra entrada de routerLink
donde se pueden pasar como
<a [routerLink]="['../']" [queryParams]="{prop: 'xxx'}">Somewhere</a>
fragment
<a [routerLink]="['../']" [queryParams]="{prop: 'xxx'}" [fragment]="yyy">Somewhere</a>
routerLinkActiveOptions
Para obtener también la clase routes active establecida en las rutas principales:
[routerLinkActiveOptions]="{ exact: false }"
Para pasar parámetros de consulta a this.router.navigate(...)
use
let navigationExtras: NavigationExtras = {
queryParams: { 'session_id': sessionId },
fragment: 'anchor'
};
// Navigate to the login page with extras
this.router.navigate(['/login'], navigationExtras);
Véase también https://angular.io/guide/router#query-parameters-and-fragments
119
Author: Günter Zöchbauer,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2017-08-02 13:10:42
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2017-08-02 13:10:42