From ad4a674b65170e373e66ebc9e3c32c0d8ee73875 Mon Sep 17 00:00:00 2001 From: Zhicheng Wang Date: Tue, 11 Sep 2018 12:57:12 +0800 Subject: [PATCH] =?UTF-8?q?docs:=20=E6=B7=BB=E5=8A=A0=E5=A4=96=E9=83=A8?= =?UTF-8?q?=E5=AF=BC=E8=88=AA=E9=93=BE=E6=8E=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- aio/content/navigation.json | 10 ++++++++++ aio/src/app/layout/nav-item/nav-item.component.html | 3 ++- aio/src/app/layout/nav-item/nav-item.component.ts | 4 ++++ 3 files changed, 16 insertions(+), 1 deletion(-) diff --git a/aio/content/navigation.json b/aio/content/navigation.json index 24bd69f3ea..d7e336336b 100644 --- a/aio/content/navigation.json +++ b/aio/content/navigation.json @@ -545,6 +545,16 @@ "tooltip": "关于 Angular 中类和值的详细信息。", "url": "api" }, + { + "title": "互助问答", + "tooltip": "github 上的中文互助问答区", + "url": "https://github.com/ng-docs/ng-docs.github.io/issues" + }, + { + "title": "Material 组件库", + "tooltip": "Angular Material 组件库的中文文档", + "url": "https://material.angular.cn" + }, { "url": "guide/change-log", "title": "Change Log", diff --git a/aio/src/app/layout/nav-item/nav-item.component.html b/aio/src/app/layout/nav-item/nav-item.component.html index 5e76ec1e46..2df6b2294f 100644 --- a/aio/src/app/layout/nav-item/nav-item.component.html +++ b/aio/src/app/layout/nav-item/nav-item.component.html @@ -1,7 +1,8 @@
+ class="vertical-menu-item" style="position: relative" [target]="isExternalUrl(node.url)?'_blank':'_self'"> {{node.title}} + open_in_new
diff --git a/aio/src/app/layout/nav-item/nav-item.component.ts b/aio/src/app/layout/nav-item/nav-item.component.ts index a62612f834..3e2f16b05e 100644 --- a/aio/src/app/layout/nav-item/nav-item.component.ts +++ b/aio/src/app/layout/nav-item/nav-item.component.ts @@ -47,4 +47,8 @@ export class NavItemComponent implements OnChanges { this.isExpanded = !this.isExpanded; this.setClasses(); } + + isExternalUrl(url: string): boolean { + return /^https?:/.test(url); + } }