Warning: mysqli_num_fields() expects parameter 1 to be mysqli_result, boolean given in /www/wwwroot/dev.zhalaotie.com/wp-includes/wp-db.php on line 3215

Warning: mysqli_num_fields() expects parameter 1 to be mysqli_result, boolean given in /www/wwwroot/dev.zhalaotie.com/wp-includes/wp-db.php on line 3215
Angular 2/4 router Passing Query Parameters – 扎老铁
Warning: mysqli_num_fields() expects parameter 1 to be mysqli_result, boolean given in /www/wwwroot/dev.zhalaotie.com/wp-includes/wp-db.php on line 3215

Warning: mysqli_num_fields() expects parameter 1 to be mysqli_result, boolean given in /www/wwwroot/dev.zhalaotie.com/wp-includes/wp-db.php on line 3215
Warning: mysqli_num_fields() expects parameter 1 to be mysqli_result, boolean given in /www/wwwroot/dev.zhalaotie.com/wp-includes/wp-db.php on line 3215
class="post-52866 post type-post status-publish format-standard hentry">

Angular 2/4 router Passing Query Parameters

 

Passing Query Parameters

Use the [queryParams] directive along with [routerLink] to pass query parameters. For example:

<a [routerLink]=”[‘product-list’]” [queryParams]=”{ page: 99 }”>Go to Page 99</a>

 

Alternatively, we can navigate programmatically using the Router service:

goToPage(pageNum) {
this.router.navigate([‘/product-list’], { queryParams: { page: pageNum } });
}

 

发表评论

电子邮件地址不会被公开。