完善翻译
This commit is contained in:
Eriice 2019-01-16 15:01:56 +08:00 committed by 雪狼
parent b9b402747b
commit 2d83508e82
2 changed files with 4 additions and 4 deletions

View File

@ -134,7 +134,7 @@ You are registering it with an _injector_, which is the object that is responsib
By default, the Angular CLI command `ng generate service` registers a provider with the _root injector_ for your service by including provider metadata in the `@Injectable` decorator.
默认情况下Angular CLI 命令 `ng generate service` 会通过给 `@Injectable` 装饰器添加元数据的形式,为该服务把提供商注册到*根注入器*上
默认情况下Angular CLI 命令 `ng generate service` 会通过给 `@Injectable` 装饰器添加元数据的形式,用*根注入器*将你的服务注册成为提供商
If you look at the `@Injectable()` statement right before the `HeroService` class definition, you can see that the `providedIn` metadata value is 'root':
@ -249,7 +249,7 @@ It certainly shouldn't call a function that makes HTTP requests to a remote serv
让构造函数保持简单,只做初始化操作,比如把构造函数的参数赋值给属性。
构造函数不应该*做任何事*。
肯定不能调用某个函数来向远端服务(比如真实的数据服务)发起 HTTP 请求。
当然不应该调用某个函数来向远端服务(比如真实的数据服务)发起 HTTP 请求。
Instead, call `getHeroes()` inside the [*ngOnInit lifecycle hook*](guide/lifecycle-hooks) and
let Angular call `ngOnInit` at an appropriate time _after_ constructing a `HeroesComponent` instance.

View File

@ -51014,7 +51014,7 @@
{
"key": "BYDEFAULTTHEANGULARCLICOMMANDNGGENERATESERVICEREGISTERSAPROVIDERWITHTHEROOTINJECTORFORYOURSERVICEBYINCLUDINGPROVIDERMETADATAINTHEINJECTABLEDECORATOR",
"original": "By default, the Angular CLI command `ng generate service` registers a provider with the _root injector_ for your service by including provider metadata in the `@Injectable` decorator.",
"translation": "默认情况下Angular CLI 命令 `ng generate service` 会通过给 `@Injectable` 装饰器添加元数据的形式,为该服务把提供商注册到*根注入器*上。",
"translation": "默认情况下Angular CLI 命令 `ng generate service` 会通过给 `@Injectable` 装饰器添加元数据的形式,用*根注入器*将你的服务注册成为提供商。",
"sourceFile": "/Users/twer/private/GDE/angular-cn/aio/content/tutorial/toh-pt4.md"
},
{
@ -51128,7 +51128,7 @@
{
"key": "RESERVETHECONSTRUCTORFORSIMPLEINITIALIZATIONSUCHASWIRINGCONSTRUCTORPARAMETERSTOPROPERTIESTHECONSTRUCTORSHOULDNTDOANYTHINGITCERTAINLYSHOULDNTCALLAFUNCTIONTHATMAKESHTTPREQUESTSTOAREMOTESERVERASAREALDATASERVICEWOULD",
"original": "Reserve the constructor for simple initialization such as wiring constructor parameters to properties.\nThe constructor shouldn't _do anything_.\nIt certainly shouldn't call a function that makes HTTP requests to a remote server as a _real_ data service would.",
"translation": "让构造函数保持简单,只做初始化操作,比如把构造函数的参数赋值给属性。\n构造函数不应该*做任何事*。\n它肯定不能调用某个函数来向远端服务(比如真实的数据服务)发起 HTTP 请求。",
"translation": "让构造函数保持简单,只做初始化操作,比如把构造函数的参数赋值给属性。\n构造函数不应该*做任何事*。\n它当然不应该调用某个函数来向远端服务(比如真实的数据服务)发起 HTTP 请求。",
"sourceFile": "/Users/twer/private/GDE/angular-cn/aio/content/tutorial/toh-pt4.md"
},
{