本文整理匯總了TypeScript中angular2/router.Location.go方法的典型用法代碼示例。如果您正苦於以下問題:TypeScript Location.go方法的具體用法?TypeScript Location.go怎麽用?TypeScript Location.go使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類angular2/router.Location
的用法示例。
在下文中一共展示了Location.go方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。
示例1: setSearchParams
/** Set state params */
setSearchParams() {
let queryString = '/';
if (this.yearParam || this.typeParam) {
queryString = '/?'
}
if (this.yearParam && this.monthParam) {
queryString = queryString + 'year=' + this.yearParam;
queryString = queryString + '&month=' + REVERSE_MONTH_LOOKUP[this.monthParam];
}
if (this.typeParam) {
if (this.yearParam) {
queryString = queryString + '&'
}
queryString = queryString + 'type=' + this.typeParam;
}
this._location.go(queryString);
}
示例2: showBookDetail
showBookDetail(id: string)
{
this.location.go('/books/details/' + id)
}
示例3: constructor
constructor(location: Location) {
location.go('/home');
}
示例4: constructor
constructor(private location:Location){
location.go('/About');
}
示例5: constructor
constructor(location: Location) {
location.go('/video');
}