0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

[Angular] Angular公式の日本語版と英語版の違い

Last updated at Posted at 2021-01-08

Angularのチュートリアルでの勉強は昨日やったところまでで終わりにしようと思っていたのですが、その続きの部分をちょこちょこと見ていたら、ちょっと気づいたことがあります。

Angular公式の日本語版と英語版の違い

Angular公式日本語版

ナビゲーションの追加というドキュメントのngOnInit()メソッドのコードです。

product-details.component.ts
ngOnInit() {
  this.route.paramMap.subscribe(params => {
    this.product = products[+params.get('productId')];
  });
}

Angular公式英語版

英語版では下記のようになっていますね。

product-details.component.ts
ngOnInit() {
  // First get the product id from the current route.
  const routeParams = this.route.snapshot.paramMap;
  const productIdFromRoute = Number(routeParams.get('productId'));

  // Find the product that correspond with the id provided in route.
  this.product = products.find(product => product.id === productIdFromRoute);
}

(日本語版はきっとボランティア的に翻訳して下さっている方々がいらっしゃるのかなと思います。)

もちろん英語版が本家ですから、英語版の方が新しい情報かとは思います。

(プログラミングって、バージョンの違いか環境の違いでプログラムの書き方によってコンパイルエラーになることがありますね。)

0
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?