fix: ssr issue for typescript

This commit is contained in:
Zhicheng Wang 2018-10-24 16:38:39 +08:00
parent 28026cfc84
commit e390d44e98
4 changed files with 7 additions and 1 deletions

View File

@ -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):

View File

@ -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.

View File

@ -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.

View File

@ -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));