LoginSignup
16
12

More than 5 years have passed since last update.

Angular + Typescriptをブラウザでデバッグしたい

Last updated at Posted at 2017-02-14

はじめに

Angularプロジェクトをブラウザでデバッグする際に、TypescriptファイルにBreakPointを設定する方法がわからなかったので調べた。

環境

  • Angular: 2.4.7
  • angular-cli: 1.0.0-beta.28.3
  • webpack: 2.2.0
  • Google Chrome: 53.0.2785.116
  • 各種設定ファイルは、Angular CLIでプロジェクト作成後、デフォルト設定のまま
  • エディタはVisual Studio Code(1.7.2)を使用

デバッグ方法

  1. Angular CLIで雛形プロジェクトを作成した後、ng serveコマンドで開発ビルド&実行する
  2. Chromeのdeveloper toolsを起動する
  3. Sourcesタブを選択 Kobito.XNYA9r.png

webpack://配下にTypescriptファイルが配置されているのでBreakPointを設定することができる。

画像の例では、src/app/app.component.ts ファイルにBreakPointを設定している。

16
12
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
16
12