本文整理汇总了TypeScript中nativescript-angular/router/ns-location-strategy.NSLocationStrategy.pushState方法的典型用法代码示例。如果您正苦于以下问题:TypeScript NSLocationStrategy.pushState方法的具体用法?TypeScript NSLocationStrategy.pushState怎么用?TypeScript NSLocationStrategy.pushState使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类nativescript-angular/router/ns-location-strategy.NSLocationStrategy
的用法示例。
在下文中一共展示了NSLocationStrategy.pushState方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: simulatePageNavigation
function simulatePageNavigation(strategy: NSLocationStrategy, url: string, frame: any, outletName?: string) {
outletName = outletName || "primary";
strategy.pushState(null, null, url, null);
const outlet: Outlet = strategy.findOutletByOutletPath(outletName);
outlet.frame = frame;
strategy._beginPageNavigation(frame);
}
示例2: simulatePageNavigation
function simulatePageNavigation(strategy: NSLocationStrategy, url: string) {
strategy.pushState(null, null, url, null);
strategy._beginPageNavigation();
}
示例3: initStrategy
function initStrategy(back?: () => void): NSLocationStrategy {
const strategy = new NSLocationStrategy(new FakeFrame(back));
strategy.pushState(null, null, "/", null); // load initial state
return strategy;
}
示例4: initStrategy
// tslint:disable-next-line:max-line-length
function initStrategy(initUrl: string, back?: () => void): { strategy: NSLocationStrategy, frameService: FrameService } {
const frameService = new FakeFrameService(back);
const strategy = new NSLocationStrategy(frameService);
strategy.pushState(null, null, initUrl, null); // load initial state
return { strategy: strategy, frameService: frameService };
}