Merge pull request #2 from angular/dependency-injection-rex

review di.
This commit is contained in:
Yang Lin 2016-11-27 01:14:29 +08:00 committed by GitHub
commit 72c22e17cc

View File

@ -681,7 +681,8 @@ block injectable-not-always-needed-in-ts
identify a class as a target for instantiation by an injector. identify a class as a target for instantiation by an injector.
我们**可以**添加它。但是没有必要,因为`HerosComponent`已经有`@Component`装饰器了, 我们**可以**添加它。但是没有必要,因为`HerosComponent`已经有`@Component`装饰器了,
`@Component`(和随后将会学到的`@Directive`和`@Pipe`一样)是 <a href="#{injUrl}">Injectable</a> 的子类型。实际上,正是这些`Injectable`装饰器是把一个类标识为注入器实例化的目标。 `@Component`(和随后将会学到的`@Directive`和`@Pipe`一样)是 <a href="#{injUrl}">Injectable</a> 的子类型。
实际上,正是这些`Injectable`装饰器是把一个类标识为注入器实例化的目标。
+ifDocsFor('ts') +ifDocsFor('ts')
.l-sub-section .l-sub-section