fix: 把“顶级”统一换成“顶层”
This commit is contained in:
parent
fab7f9acbd
commit
ef80c60800
@ -37,7 +37,7 @@ The template options object, `angularCompilerOptions`, is a sibling to the `comp
|
||||
Like the TypeScript compiler, The Angular AOT compiler also supports `extends` in the `angularCompilerOptions` section of the TypeScript configuration file, `tsconfig.json`.
|
||||
The `extends` property is at the top level, parallel to `compilerOptions` and `angularCompilerOptions`.
|
||||
|
||||
像 TypeScript 编译器一样,Angular 的 AOT 编译器也支持对 TypeScript 配置文件 `tsconfig.json` 的 `angularCompilerOptions` 进行 `extends`。`extends` 属性位于顶级,和 `compilerOptions` 和 `angularCompilerOptions` 平级。
|
||||
像 TypeScript 编译器一样,Angular 的 AOT 编译器也支持对 TypeScript 配置文件 `tsconfig.json` 的 `angularCompilerOptions` 进行 `extends`。`extends` 属性位于顶层,和 `compilerOptions` 和 `angularCompilerOptions` 平级。
|
||||
|
||||
|
||||
A TypeScript configuration can inherit settings from another file using the `extends` property.
|
||||
|
@ -63,7 +63,7 @@ Angular 提供了一些构建器,供 CLI 命令使用,如 `ng build`、`ng t
|
||||
A builder resides in a "project" folder that is similar in structure to an Angular workspace, with global configuration files at the top level, and more specific configuration in a source folder with the code files that define the behavior.
|
||||
For example, your `myBuilder` folder could contain the following files.
|
||||
|
||||
构建器位于一个 `project` 文件夹中,该文件夹的结构类似于 Angular 工作区,包括位于顶级的全局配置文件,以及位于工作代码所在源文件夹中的更具体的配置。例如,`myBuilder` 文件夹中可能包含如下文件。
|
||||
构建器位于一个 `project` 文件夹中,该文件夹的结构类似于 Angular 工作区,包括位于顶层的全局配置文件,以及位于工作代码所在源文件夹中的更具体的配置。例如,`myBuilder` 文件夹中可能包含如下文件。
|
||||
|
||||
| FILES | PURPOSE |
|
||||
| :----------------------- | :------------------------------------------------------------------------------------------- |
|
||||
|
@ -50,7 +50,7 @@ from the [The Tour of Heroes](tutorial/). This simple version doesn't use DI; we
|
||||
`HeroesComponent` is the top-level heroes component.
|
||||
Its only purpose is to display `HeroListComponent`, which displays a list of hero names.
|
||||
|
||||
`HeroesComponent` 是顶级英雄管理组件。
|
||||
`HeroesComponent` 是顶层英雄管理组件。
|
||||
它唯一的目的是显示 `HeroListComponent`,该组件会显示一个英雄名字的列表。
|
||||
|
||||
This version of the `HeroListComponent` gets heroes from the `HEROES` array, an in-memory collection
|
||||
|
@ -124,7 +124,7 @@ For a multi-project workspace, additional projects in the `projects/` folder con
|
||||
|
||||
Files at the top level of `src/` support testing and running your application. Subfolders contain the application source and application-specific configuration.
|
||||
|
||||
顶级文件 `src/` 为测试并运行你的应用提供支持。其子文件夹中包含应用源代码和应用的专属配置。
|
||||
顶层文件 `src/` 为测试并运行你的应用提供支持。其子文件夹中包含应用源代码和应用的专属配置。
|
||||
|
||||
|
||||
| APP SUPPORT FILES | PURPOSE |
|
||||
|
@ -168,7 +168,7 @@ In Angular, an app's root NgModule (`AppModule`) has a `bootstrap` property that
|
||||
During the bootstrap process, Angular creates and inserts these components into the `index.html` host web page.
|
||||
You can bootstrap multiple apps in the same `index.html`. Each app contains its own components.
|
||||
|
||||
在 Angular 中,应用的根模块(`AppModule`)有一个 `bootstrap` 属性,用于指出该应用的的顶级[组件](#component)。
|
||||
在 Angular 中,应用的根模块(`AppModule`)有一个 `bootstrap` 属性,用于指出该应用的的顶层[组件](#component)。
|
||||
在引导期间,Angular 会创建这些组件,并插入到宿主页面 `index.html` 中。
|
||||
你可以在同一个 `index.html` 中引导多个应用,每个应用都有一些自己的组件。
|
||||
|
||||
|
@ -72,11 +72,11 @@ typical characteristics, in real world apps, you may see hybrids.
|
||||
|
||||
They typically have a top component that acts as the feature root and private, supporting sub-components descend from it.
|
||||
|
||||
它们通常会有一个顶级组件来充当该特性的根组件,并且通常是私有的。用来支持它的各级子组件。
|
||||
它们通常会有一个顶层组件来充当该特性的根组件,并且通常是私有的。用来支持它的各级子组件。
|
||||
|
||||
Domain feature modules consist mostly of declarations. Only the top component is exported.
|
||||
|
||||
领域特性模块大部分由 `declarations` 组成,只有顶级组件会被导出。
|
||||
领域特性模块大部分由 `declarations` 组成,只有顶层组件会被导出。
|
||||
|
||||
Domain feature modules rarely have providers. When they do, the lifetime of the provided services should be the same as the lifetime of the module.
|
||||
|
||||
@ -350,7 +350,7 @@ The following table summarizes the key characteristics of each feature module gr
|
||||
|
||||
Top component
|
||||
|
||||
顶级组件
|
||||
顶层组件
|
||||
|
||||
</td>
|
||||
|
||||
|
@ -538,8 +538,8 @@ Add the custom `HttpBackend` provider to the top component's `providers` list ra
|
||||
Recall that Angular creates a child injector for each component instance and populates the injector
|
||||
with the component's own providers.
|
||||
|
||||
那就创建一个“顶级组件”来扮演该模块中所有组件的根。
|
||||
把这个自定义的 `HttpBackend` 提供商添加到这个顶级组件的 `providers` 列表中,而不是该模块的 `providers` 中。
|
||||
那就创建一个“顶层组件”来扮演该模块中所有组件的根。
|
||||
把这个自定义的 `HttpBackend` 提供商添加到这个顶层组件的 `providers` 列表中,而不是该模块的 `providers` 中。
|
||||
回忆一下,Angular 会为每个组件实例创建一个子注入器,并使用组件自己的 `providers` 来配置这个注入器。
|
||||
|
||||
When a child of this component asks for the `HttpBackend` service,
|
||||
@ -552,13 +552,13 @@ Child components make proper HTTP requests no matter what other modules do to `H
|
||||
|
||||
Be sure to create module components as children of this module's top component.
|
||||
|
||||
确保把模块中的组件都创建成这个顶级组件的子组件。
|
||||
确保把模块中的组件都创建成这个顶层组件的子组件。
|
||||
|
||||
You can embed the child components in the top component's template.
|
||||
Alternatively, make the top component a routing host by giving it a `<router-outlet>`.
|
||||
Define child routes and let the router load module components into that outlet.
|
||||
|
||||
你可以把这些子组件都嵌在顶级组件的模板中。或者,给顶级组件一个 `<router-outlet>`,让它作为路由的宿主。
|
||||
你可以把这些子组件都嵌在顶层组件的模板中。或者,给顶层组件一个 `<router-outlet>`,让它作为路由的宿主。
|
||||
定义子路由,并让路由器把模块中的组件加载进该路由出口(outlet)中。
|
||||
|
||||
Though you can limit access to a service by providing it in a lazy loaded module or providing it in a component, providing services in a component can lead to multiple instances of those services. Thus, the lazy loading is preferable.
|
||||
|
@ -779,7 +779,7 @@ Listed below are the base classes and services used to create and manage form co
|
||||
|
||||
Manages the value and validity state of a group of `AbstractControl` instances. The group's properties include its child controls. The top-level form in your component is `FormGroup`.
|
||||
|
||||
管理一组 `AbstractControl` 实例的值和有效性状态。该组的属性中包括了它的子控件。组件中的顶级表单就是 `FormGroup`。
|
||||
管理一组 `AbstractControl` 实例的值和有效性状态。该组的属性中包括了它的子控件。组件中的顶层表单就是 `FormGroup`。
|
||||
|
||||
</td>
|
||||
|
||||
|
@ -30,7 +30,7 @@ Routing enables users to navigate between different routes in an application. Wh
|
||||
|
||||
The Angular router comes with high-level animation functions that let you animate the transitions between views when a route changes. To produce an animation sequence when switching between routes, you need to define nested animation sequences. Start with the top-level component that hosts the view, and nest additional animations in the components that host the embedded views.
|
||||
|
||||
Angular 路由器天生带有高级动画功能,它可以让你为在路由变化时为视图之间设置转场动画。要想在路由切换时生成动画序列,你需要首先定义出嵌套的动画序列。从宿主视图的顶级组件开始,在这些内嵌视图的宿主组件中嵌套添加其它动画。
|
||||
Angular 路由器天生带有高级动画功能,它可以让你为在路由变化时为视图之间设置转场动画。要想在路由切换时生成动画序列,你需要首先定义出嵌套的动画序列。从宿主视图的顶层组件开始,在这些内嵌视图的宿主组件中嵌套添加其它动画。
|
||||
|
||||
To enable routing transition animation, do the following:
|
||||
|
||||
@ -50,7 +50,7 @@ To enable routing transition animation, do the following:
|
||||
|
||||
Let's illustrate a router transition animation by navigating between two routes, *Home* and *About* associated with the `HomeComponent` and `AboutComponent` views respectively. Both of these component views are children of the top-most view, hosted by `AppComponent`. We'll implement a router transition animation that slides in the new view to the right and slides out the old view when the user navigates between the two routes.
|
||||
|
||||
让我们以两个路由之间的导航过程来解释一下路由转场动画,*Home* 和 *About* 分别与 `HomeComponent` 和 `AboutComponent` 的视图相关联。所有这些组件视图都是顶级视图的子节点,其宿主是 `AppComponent`。我们将实现路由器过渡动画,该动画会在出现新视图时向右滑动,并当用户在两个路由之间导航时把旧视图滑出。
|
||||
让我们以两个路由之间的导航过程来解释一下路由转场动画,*Home* 和 *About* 分别与 `HomeComponent` 和 `AboutComponent` 的视图相关联。所有这些组件视图都是顶层视图的子节点,其宿主是 `AppComponent`。我们将实现路由器过渡动画,该动画会在出现新视图时向右滑动,并当用户在两个路由之间导航时把旧视图滑出。
|
||||
|
||||
</br>
|
||||
|
||||
@ -74,7 +74,7 @@ Use the `RouterModule.forRoot` method to define a set of routes. Also, import th
|
||||
|
||||
**Note:** Use the `RouterModule.forRoot` method in the root module, `AppModule`, to register top-level application routes and providers. For feature modules, call the `RouterModule.forChild` method to register additional routes.
|
||||
|
||||
**注意:**在根模块 `AppModule` 中使用 `RouterModule.forRoot` 方法来注册一些顶级应用路由和提供商。对于特性模块,调用 `RouterModule.forChild` 方法来注册其它路由。
|
||||
**注意:**在根模块 `AppModule` 中使用 `RouterModule.forRoot` 方法来注册一些顶层应用路由和提供商。对于特性模块,调用 `RouterModule.forChild` 方法来注册其它路由。
|
||||
|
||||
</div>
|
||||
|
||||
|
@ -1539,7 +1539,7 @@ Technically, `pathMatch = 'full'` results in a route hit when the *remaining*, u
|
||||
In this example, the redirect is in a top level route so the *remaining* URL and the *entire* URL are the same thing.
|
||||
|
||||
从技术角度说,`pathMatch = 'full'` 导致 URL 中*剩下的*、未匹配的部分必须等于 `''`。
|
||||
在这个例子中,跳转路由在一个顶级路由中,因此*剩下的*URL 和*完整的*URL 是一样的。
|
||||
在这个例子中,跳转路由在一个顶层路由中,因此*剩下的*URL 和*完整的*URL 是一样的。
|
||||
|
||||
The other possible `pathMatch` value is `'prefix'` which tells the router
|
||||
to match the redirect route when the *remaining* URL ***begins*** with the redirect route's _prefix_ path.
|
||||
@ -2248,7 +2248,7 @@ Only call `RouterModule.forRoot()` in the root `AppRoutingModule`
|
||||
(or the `AppModule` if that's where you register top level application routes).
|
||||
In any other module, you must call the **`RouterModule.forChild`** method to register additional routes.
|
||||
|
||||
只在根模块 `AppRoutingModule` 中调用 `RouterModule.forRoot()`(如果在 `AppModule` 中注册应用的顶级路由,那就在 `AppModule` 中调用)。
|
||||
只在根模块 `AppRoutingModule` 中调用 `RouterModule.forRoot()`(如果在 `AppModule` 中注册应用的顶层路由,那就在 `AppModule` 中调用)。
|
||||
在其它模块中,你就必须调用**`RouterModule.forChild`**方法来注册附属路由。
|
||||
|
||||
</div>
|
||||
@ -3632,7 +3632,7 @@ But child routes *extend* the path of the parent route.
|
||||
With each step down the route tree,
|
||||
you add a slash followed by the route path, unless the path is _empty_.
|
||||
|
||||
在顶级,以 `/` 开头的路径指向的总是应用的根。
|
||||
在顶层,以 `/` 开头的路径指向的总是应用的根。
|
||||
但这里是子路由。
|
||||
它们是在父路由路径的基础上做出的扩展。
|
||||
在路由树中每深入一步,你就会在该路由的路径上添加一个斜线 `/`(除非该路由的路径是*空的*)。
|
||||
@ -3696,7 +3696,7 @@ The feature routes are now provided by the `HeroesModule` and the `CrisisCenter`
|
||||
|
||||
The `app-routing.module.ts` file retains the top-level application routes such as the default and wildcard routes.
|
||||
|
||||
`app-routing.module.ts` 文件中只有应用的顶级路由,比如默认路由和通配符路由。
|
||||
`app-routing.module.ts` 文件中只有应用的顶层路由,比如默认路由和通配符路由。
|
||||
|
||||
<code-example path="router/src/app/app-routing.module.3.ts" header="src/app/app-routing.module.ts (v3)" region="v3"></code-example>
|
||||
|
||||
|
@ -22,7 +22,7 @@ Angular 当前有三种执行此操作的模式,具体取决于 [TypeScript
|
||||
|
||||
In the most basic type-checking mode, with the `fullTemplateTypeCheck` flag set to `false`, Angular validates only top-level expressions in a template.
|
||||
|
||||
在最基本的类型检查模式下,将 `fullTemplateTypeCheck` 标志设置为 `false` ,Angular 仅验证模板中的顶级表达式。
|
||||
在最基本的类型检查模式下,将 `fullTemplateTypeCheck` 标志设置为 `false` ,Angular 仅验证模板中的顶层表达式。
|
||||
|
||||
|
||||
If you write `<map [city]="user.address.city">`, the compiler verifies the following:
|
||||
|
@ -307,7 +307,7 @@ Those elements can still animate.
|
||||
|
||||
To disable all animations for an Angular app, place the `@.disabled` host binding on the topmost Angular component.
|
||||
|
||||
要禁用 Angular 应用中的所有动画,只要把 `@.disabled` 绑定放在顶级的 Angular 组件上即可。
|
||||
要禁用 Angular 应用中的所有动画,只要把 `@.disabled` 绑定放在顶层的 Angular 组件上即可。
|
||||
|
||||
<code-example path="animations/src/app/app.component.ts" header="src/app/app.component.ts" region="toggle-app-animations" language="typescript"></code-example>
|
||||
|
||||
|
@ -14,11 +14,11 @@ Angular [工作区](guide/glossary#workspace)根目录下的 `angular.json` 文
|
||||
|
||||
At the top level of `angular.json`, a few properties configure the workspace, and a `projects` section contains the remaining per-project configuration options. CLI defaults set at the workspace level can be overridden by defaults set at the project level, and defaults set at the project level can be overridden on the command line.
|
||||
|
||||
在 `angular.json` 的顶级,一些属性用于配置工作区,其中的 `projects` 区则包含其余的针对每个项目的配置项。CLI 在工作空间级的默认设置可以被项目级的设置所覆盖,而项目级的设置可以被命令行中的设置所覆盖。
|
||||
在 `angular.json` 的顶层,一些属性用于配置工作区,其中的 `projects` 区则包含其余的针对每个项目的配置项。CLI 在工作空间级的默认设置可以被项目级的设置所覆盖,而项目级的设置可以被命令行中的设置所覆盖。
|
||||
|
||||
The following properties, at the top level of the file, configure the workspace.
|
||||
|
||||
下列属性位于文件的顶级,用于配置工作空间。
|
||||
下列属性位于文件的顶层,用于配置工作空间。
|
||||
|
||||
* `version`: The configuration-file version.
|
||||
|
||||
@ -85,7 +85,7 @@ When you create a library project with `ng generate library`, the library projec
|
||||
|
||||
The following top-level configuration properties are available for each project, under `projects:<project_name>`.
|
||||
|
||||
每个项目的 `projects:<project_name>` 下都有以下顶级配置属性。
|
||||
每个项目的 `projects:<project_name>` 下都有以下顶层配置属性。
|
||||
|
||||
<code-example language="json">
|
||||
"my-app": {
|
||||
@ -264,7 +264,7 @@ Note that all options in the configuration file must use [camelCase](guide/gloss
|
||||
|
||||
The `architect/build` section configures defaults for options of the `ng build` command. It has the following top-level properties.
|
||||
|
||||
`architect/build` 节会为 `ng build` 命令的选项配置默认值。它具有下列顶级属性。
|
||||
`architect/build` 节会为 `ng build` 命令的选项配置默认值。它具有下列顶层属性。
|
||||
|
||||
| PROPERTY | DESCRIPTION |
|
||||
| :-------------- | :---------------------------- |
|
||||
|
@ -275,7 +275,7 @@ Other critical metadata is in [`@NgModule`](guide/ngmodules) decorators.
|
||||
|
||||
The most important `@NgModule` decorator annotates the top-level **AppModule** class.
|
||||
|
||||
最重要的 `@NgModule` 装饰器位于顶级类 **AppModule** 上。
|
||||
最重要的 `@NgModule` 装饰器位于顶层类 **AppModule** 上。
|
||||
|
||||
The Angular CLI generated an `AppModule` class in `src/app/app.module.ts` when it created the project.
|
||||
This is where you _opt-in_ to the `FormsModule`.
|
||||
|
@ -37,7 +37,7 @@ When you’re done, users will be able to navigate the app like this:
|
||||
In Angular, the best practice is to load and configure the router in a separate, top-level module
|
||||
that is dedicated to routing and imported by the root `AppModule`.
|
||||
|
||||
在 Angular 中,最好在一个独立的顶级模块中加载和配置路由器,它专注于路由功能,然后由根模块 `AppModule` 导入它。
|
||||
在 Angular 中,最好在一个独立的顶层模块中加载和配置路由器,它专注于路由功能,然后由根模块 `AppModule` 导入它。
|
||||
|
||||
By convention, the module class name is `AppRoutingModule` and it belongs in the `app-routing.module.ts` in the `src/app` folder.
|
||||
|
||||
@ -143,7 +143,7 @@ configures it with the `routes` in one step by calling
|
||||
The `forRoot()` method supplies the service providers and directives needed for routing,
|
||||
and performs the initial navigation based on the current browser URL.
|
||||
|
||||
这个方法之所以叫 `forRoot()`,是因为你要在应用的顶级配置这个路由器。
|
||||
这个方法之所以叫 `forRoot()`,是因为你要在应用的顶层配置这个路由器。
|
||||
`forRoot()` 方法会提供路由所需的服务提供商和指令,还会基于浏览器的当前 URL 执行首次导航。
|
||||
|
||||
</div>
|
||||
@ -336,7 +336,7 @@ The _class_ is similar to the `HeroesComponent` class.
|
||||
|
||||
This `getHeroes()` returns the sliced list of heroes at positions 1 and 5, returning only four of the Top Heroes (2nd, 3rd, 4th, and 5th).
|
||||
|
||||
这个 `getHeroes()` 函数会截取第 2 到 第 5 位英雄,也就是说只返回四个顶级英雄(第二,第三,第四和第五)。
|
||||
这个 `getHeroes()` 函数会截取第 2 到 第 5 位英雄,也就是说只返回四个顶层英雄(第二,第三,第四和第五)。
|
||||
|
||||
<code-example path="toh-pt5/src/app/dashboard/dashboard.component.ts" header="src/app/dashboard/dashboard.component.ts" region="getHeroes">
|
||||
</code-example>
|
||||
|
@ -12,7 +12,7 @@ import { NavigationNode } from 'app/navigation/navigation.service';
|
||||
<ul role="navigation">
|
||||
<li *ngFor="let node of nodes">
|
||||
<a class="nav-link" [class.highlight]="node.highlight" [href]="node.url" [title]="node.tooltip || node.title"
|
||||
[target]="node.external?'_blank':null">
|
||||
[target]="node.external?'_blank':undefined">
|
||||
<span class="nav-link-inner">{{ node.title }}</span>
|
||||
</a>
|
||||
</li>
|
||||
|
Loading…
x
Reference in New Issue
Block a user