SAP Spartacus的navigation初始化
生活随笔
收集整理的這篇文章主要介紹了
SAP Spartacus的navigation初始化
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
SAP Spartacus navigation入口:
/*** Sets up the location change listener and performs the initial navigation.*/initialNavigation() {this.setUpLocationChangeListener();if (this.navigationId === 0) {this.navigateByUrl(this.location.path(true), { replaceUrl: true });}} /*** Navigates to a view using an absolute route path.** @param url An absolute path for a defined route. The function does not apply any delta to the* current URL.* @param extras An object containing properties that modify the navigation strategy.* The function ignores any properties in the `NavigationExtras` that would change the* provided URL.** @returns A Promise that resolves to 'true' when navigation succeeds,* to 'false' when navigation fails, or is rejected on error.** @usageNotes** The following calls request navigation to an absolute path.** ```* router.navigateByUrl("/team/33/user/11");** // Navigate without updating the URL* router.navigateByUrl("/team/33/user/11", { skipLocationChange: true });* ```** @see [Routing and Navigation guide](guide/router)**/navigateByUrl(url, extras = { skipLocationChange: false }) {if (isDevMode() && this.isNgZoneEnabled && !NgZone.isInAngularZone()) {this.console.warn(`Navigation triggered outside Angular zone, did you forget to call 'ngZone.run()'?`);}const urlTree = isUrlTree(url) ? url : this.parseUrl(url);const mergedTree = this.urlHandlingStrategy.merge(urlTree, this.rawUrlTree);return this.scheduleNavigation(mergedTree, 'imperative', null, extras);}
RouterStateSnapshot的url字段里包含的electronics-spa/en/USD是怎么來的?
ActivatedRouteSnapshot
array是一個閉包:
此時還沒有從后臺請求數據,前臺怎么知道url應該為electronics-spa/en/USD?
要獲取更多Jerry的原創文章,請關注公眾號"汪子熙":
總結
以上是生活随笔為你收集整理的SAP Spartacus的navigation初始化的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 打开word文档时,出现office更新
- 下一篇: SAP Spartacus HTTP拦截