當前位置: 首頁>>代碼示例>>TypeScript>>正文


TypeScript crossroads.parse函數代碼示例

本文整理匯總了TypeScript中crossroads.parse函數的典型用法代碼示例。如果您正苦於以下問題:TypeScript parse函數的具體用法?TypeScript parse怎麽用?TypeScript parse使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。


在下文中一共展示了parse函數的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。

示例1: changeHash

	private changeHash(newHash, oldHash) {
		let route = newHash;
		//if (route) {
		//    history.replaceState({url: route}, "", location.protocol + '//' + location.host + '/' + route);
		//}
		//else {
		//    history.replaceState({url: '/' }, "", location.protocol + '//' + location.host);
		//}
		crossroads.parse(newHash);
	}
開發者ID:robertsundstrom,項目名稱:express-knockout-spa,代碼行數:10,代碼來源:router.ts

示例2: parseHash

	private parseHash(newHash, oldHash) {
		//if (newHash == "")
		//{
		//    if(location.pathname != "/" && location.pathname.length > 1)
		//    {
		//        newHash = location.pathname.slice(1);
		//    }
		//}
		crossroads.parse(newHash);
	}
開發者ID:robertsundstrom,項目名稱:express-knockout-spa,代碼行數:10,代碼來源:router.ts

示例3:

 this.eventDispatcherService.dispatch('inspectorExit').then((isBlockingNeeded) => {
     if (!isBlockingNeeded) {
         this.currentSectionId = RoutingService.getPathSection(newHash);
         if (oldHash !== newHash) {
             crossroads.ignoreState = true;
             crossroads.parse(decodeURIComponent(newHash));
             crossroads.ignoreState = false;
         }
         this.eventDispatcherService.dispatch('hashChange', newHash);
     } else {
         this.changeHash(oldHash);
         this.eventDispatcherService.dispatch('hashChange', oldHash);
     }
 });
開發者ID:pchaussalet,項目名稱:gui,代碼行數:14,代碼來源:routing-service.ts

示例4: navigate

 public navigate(path: string, force?: boolean) {
     force = !!force;
     if (hasher.appendHash.length === 0) {
         hasher.appendHash = '?' + location.hash.split('?')[1] || this.middlewareClient.getExplicitHostParam();
     } else {
         hasher.appendHash = _.replace(hasher.appendHash, /^\?\?+/, '?');
     }
     if (force) {
         let section = RoutingService.getPathSection(path);
         if (path === '/' + section) {
             this.currentStacks.delete(section);
         } else {
             crossroads.ignoreState = true;
             crossroads.parse(path);
             crossroads.ignoreState = false;
         }
     }
     if (path[0] === '/') {
         hasher.setHash(path);
     } else {
         hasher.setHash(hasher.getHash() + '/' + path);
     }
 }
開發者ID:pchaussalet,項目名稱:gui,代碼行數:23,代碼來源:routing-service.ts


注:本文中的crossroads.parse函數示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。