From e390d44e98974d12010f69dd726f34e82933401a Mon Sep 17 00:00:00 2001 From: Zhicheng Wang Date: Wed, 24 Oct 2018 16:38:39 +0800 Subject: [PATCH] fix: ssr issue for typescript --- aio/content/guide/architecture-components.md | 2 ++ aio/content/guide/architecture-modules.md | 2 ++ aio/content/guide/architecture-services.md | 2 ++ aio/tools/translator/bin/ssr.ts | 2 +- 4 files changed, 7 insertions(+), 1 deletion(-) diff --git a/aio/content/guide/architecture-components.md b/aio/content/guide/architecture-components.md index d21b503fa8..766b8199c7 100644 --- a/aio/content/guide/architecture-components.md +++ b/aio/content/guide/architecture-components.md @@ -1,5 +1,7 @@ # Introduction to components +# 组件简介 + A *component* controls a patch of screen called a *view*. For example, individual components define and control each of the following views from the [Tutorial](tutorial): diff --git a/aio/content/guide/architecture-modules.md b/aio/content/guide/architecture-modules.md index c5797e9ab9..e0cd78dd09 100644 --- a/aio/content/guide/architecture-modules.md +++ b/aio/content/guide/architecture-modules.md @@ -1,5 +1,7 @@ # Introduction to modules +# NgModule 简介 + Angular apps are modular and Angular has its own modularity system called *NgModules*. NgModules are containers for a cohesive block of code dedicated to an application domain, a workflow, or a closely related set of capabilities. They can contain components, service providers, and other code files whose scope is defined by the containing NgModule. They can import functionality that is exported from other NgModules, and export selected functionality for use by other NgModules. diff --git a/aio/content/guide/architecture-services.md b/aio/content/guide/architecture-services.md index b4f4048294..3da2563b78 100644 --- a/aio/content/guide/architecture-services.md +++ b/aio/content/guide/architecture-services.md @@ -1,5 +1,7 @@ # Introduction to services and dependency injection +# 服务与依赖注入简介 + *Service* is a broad category encompassing any value, function, or feature that an app needs. A service is typically a class with a narrow, well-defined purpose. It should do something specific and do it well. diff --git a/aio/tools/translator/bin/ssr.ts b/aio/tools/translator/bin/ssr.ts index ebbf17a7b1..786b5b0f97 100644 --- a/aio/tools/translator/bin/ssr.ts +++ b/aio/tools/translator/bin/ssr.ts @@ -37,7 +37,7 @@ function composePage(url) { function buildGuidePages(): void { const navigation = fs.readFileSync('./content/navigation.json', 'utf-8'); - navigation.match(/"url": "(.*?)"/g) + (navigation.match(/"url": "(.*?)"/g) || []) .map((entry) => entry.replace(/^"url": "(.*?)".*$/, '$1')) .filter(url => url.slice(0, 4) !== 'http') .forEach(url => composePage(url));