fix: 公开改为公共

This commit is contained in:
Zhicheng Wang 2018-03-09 13:23:04 +08:00
parent ead2165315
commit 524bb11cd5
5 changed files with 9 additions and 9 deletions

View File

@ -1150,7 +1150,7 @@ Obtaining a component reference is a bit tricky in Angular.
Although an Angular application is a tree of components, Although an Angular application is a tree of components,
there is no public API for inspecting and traversing that tree. there is no public API for inspecting and traversing that tree.
在Angular里获取一个组件的引用比较复杂。虽然Angular应用程序是一个组件树但它没有公开的API来在该树中巡查和穿梭。 在Angular里获取一个组件的引用比较复杂。虽然Angular应用程序是一个组件树但它没有公API来在该树中巡查和穿梭。
There is an API for acquiring a child reference. There is an API for acquiring a child reference.
Check out `Query`, `QueryList`, `ViewChildren`, and `ContentChildren` Check out `Query`, `QueryList`, `ViewChildren`, and `ContentChildren`
@ -1162,7 +1162,7 @@ There is no public API for acquiring a parent reference.
But because every component instance is added to an injector's container, But because every component instance is added to an injector's container,
you can use Angular dependency injection to reach a parent component. you can use Angular dependency injection to reach a parent component.
但没有公开的API来获取父组件的引用。但是因为每个组件的实例都被加到了依赖注入器的容器中可以使用Angular依赖注入来找到父组件。 但没有公API来获取父组件的引用。但是因为每个组件的实例都被加到了依赖注入器的容器中可以使用Angular依赖注入来找到父组件。
This section describes some techniques for doing that. This section describes some techniques for doing that.

View File

@ -218,7 +218,7 @@ The following table summarizes the `@NgModule` metadata properties.
A module can list another module among its `exports`, in which case A module can list another module among its `exports`, in which case
all of that module's public components, directives, and pipes are exported. all of that module's public components, directives, and pipes are exported.
一个模块可以把另一个模块加入自己的`exports`列表中,这时,另一个模块的所有公组件、指令和管道都会被导出。 一个模块可以把另一个模块加入自己的`exports`列表中,这时,另一个模块的所有公组件、指令和管道都会被导出。
[Re-export](guide/ngmodule-faq#q-reexport) makes module transitivity explicit. [Re-export](guide/ngmodule-faq#q-reexport) makes module transitivity explicit.
If Module 'A' re-exports `CommonModule` and Module 'B' imports Module 'A', If Module 'A' re-exports `CommonModule` and Module 'B' imports Module 'A',

View File

@ -246,7 +246,7 @@ are able to reference in their templates. These are your _public_ classes.
If you don't export a declarable class, it stays _private_, visible only to other components If you don't export a declarable class, it stays _private_, visible only to other components
declared in this NgModule. declared in this NgModule.
导出那些*其它模块*希望在自己的模板中引用的[可声明类](guide/ngmodule-faq#q-declarable)。这些也是你的*公*类。 导出那些*其它模块*希望在自己的模板中引用的[可声明类](guide/ngmodule-faq#q-declarable)。这些也是你的*公*类。
如果你不导出某个类,它就是*私有的*,只对当前模块中声明的其它组件可见。 如果你不导出某个类,它就是*私有的*,只对当前模块中声明的其它组件可见。
You _can_ export any declarable class—components, directives, and pipes—whether You _can_ export any declarable class—components, directives, and pipes—whether

View File

@ -3040,7 +3040,7 @@ because events stream *out* of that property and toward the handler in a templat
Sometimes the public name of an input/output property should be different from the internal name. Sometimes the public name of an input/output property should be different from the internal name.
有时需要让输入/输出属性的公名字不同于内部名字。 有时需要让输入/输出属性的公名字不同于内部名字。
This is frequently the case with [attribute directives](guide/attribute-directives). This is frequently the case with [attribute directives](guide/attribute-directives).
Directive consumers expect to bind to the name of the directive. Directive consumers expect to bind to the name of the directive.
@ -3068,7 +3068,7 @@ while using a different name internally.
In the example immediately above, you are actually binding *through the* `myClick` *alias* to In the example immediately above, you are actually binding *through the* `myClick` *alias* to
the directive's own `clicks` property. the directive's own `clicks` property.
幸运的是,可以使用约定俗成的公名字,同时在内部使用不同的名字。 幸运的是,可以使用约定俗成的公名字,同时在内部使用不同的名字。
在上面例子中,实际上是把`myClick`这个别名指向了指令自己的`clicks`属性。 在上面例子中,实际上是把`myClick`这个别名指向了指令自己的`clicks`属性。
You can specify the alias for the property name by passing it into the input/output decorator like this: You can specify the alias for the property name by passing it into the input/output decorator like this:
@ -3086,7 +3086,7 @@ You write a colon-delimited (`:`) string with
the directive property name on the *left* and the public alias on the *right*: the directive property name on the *left* and the public alias on the *right*:
也可在`inputs`和`outputs`数组中为属性指定别名。 也可在`inputs`和`outputs`数组中为属性指定别名。
可以写一个冒号 (`:`) 分隔的字符串,*左侧*是指令中的属性名,*右侧*则是公开的别名。 可以写一个冒号 (`:`) 分隔的字符串,*左侧*是指令中的属性名,*右侧*则是公别名。
<code-example path="template-syntax/src/app/click.directive.ts" region="output-myClick2" title="src/app/click.directive.ts" linenums="false"> <code-example path="template-syntax/src/app/click.directive.ts" region="output-myClick2" title="src/app/click.directive.ts" linenums="false">

View File

@ -615,13 +615,13 @@ Angular 将会在创建 `MessagesComponent` 的实例时 把 `MessageService`
The `messageService` property **must be public** because you're about to bind to it in the template. The `messageService` property **must be public** because you're about to bind to it in the template.
这个 `messageService` 属性必须是公开的,因为你将会在模板中绑定到它。 这个 `messageService` 属性必须是公共属性,因为你将会在模板中绑定到它。
<div class="alert is-important"> <div class="alert is-important">
Angular only binds to _public_ component properties. Angular only binds to _public_ component properties.
Angular 只会绑定到组件的*公*属性。 Angular 只会绑定到组件的*公*属性。
</div> </div>