本文整理汇总了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;未经允许,请勿转载。 |
请发表评论