diff --git a/aio/src/app/app.component.ts b/aio/src/app/app.component.ts index 2025253f1b..b9d2bab8fd 100644 --- a/aio/src/app/app.component.ts +++ b/aio/src/app/app.component.ts @@ -160,8 +160,8 @@ export class AppComponent implements OnInit { ]).subscribe(([versionInfo, versions]) => { // TODO(pbd): consider whether we can lookup the stable and next versions from the internet const computedVersions: NavigationNode[] = [ - { title: 'next 版', url: 'https://next.angular.io/' }, - { title: '同步翻译版', url: 'https://angular.cn/' }, + { mode: 'next', title: 'next 版', url: 'https://next.angular.io/' }, + { mode: 'stable', title: '同步翻译版', url: 'https://angular.cn/' }, ]; if (this.deployment.mode === 'archive') { computedVersions.push({ title: `v${versionInfo.major}` }); @@ -171,7 +171,7 @@ export class AppComponent implements OnInit { // Find the current version - eithers title matches the current deployment mode // or its title matches the major version of the current version info this.currentDocVersion = this.docVersions.find(version => - version.title === this.deployment.mode || version.title === `v${versionInfo.major}`)!; + version.mode === this.deployment.mode || version.title === `v${versionInfo.major}`)!; this.currentDocVersion.title += ` (v${versionInfo.raw})`; }); diff --git a/aio/src/app/navigation/navigation.model.ts b/aio/src/app/navigation/navigation.model.ts index c15afecac2..68e52ecabe 100644 --- a/aio/src/app/navigation/navigation.model.ts +++ b/aio/src/app/navigation/navigation.model.ts @@ -9,6 +9,7 @@ export interface NavigationNode { // always have `title`. title: string; + mode?: string; url?: string; tooltip?: string; hidden?: boolean; @@ -18,7 +19,7 @@ export interface NavigationNode { children?: NavigationNode[]; } -export type NavigationResponse = {__versionInfo: VersionInfo } & { [name: string]: NavigationNode[]|VersionInfo }; +export type NavigationResponse = { __versionInfo: VersionInfo } & { [name: string]: NavigationNode[] | VersionInfo }; export interface NavigationViews { [name: string]: NavigationNode[];