LoginSignup
1
3

More than 5 years have passed since last update.

[Angular] よく使われるモジュール達 - @NgModuleとは何か (4)

Posted at

@NgModuleとは何かを知るシリーズ4回目です。
Angular付属のよく使うモジュールの紹介です。

今までの記事です。

BrowserModule

アプリケーションをブラウザ内で実行するのに必要です。
ほぼほぼ必須ですかね。

使い方
import { BrowserModule } from "@angular/platform-browser";

CommonModule

NgIfとかNgForとかを使うのに必要です。
BrowserModule読み込めば入ってます。

使い方
import { CommonModule } from "@angular/common";

FormsModule

input系のタグでNgModelを使うのに必要です。

使い方
import { FormsModule } from "@angular/forms";

ReactiveFormsModiule

NgModelではなく、新しいFormGroupFormControlを使うのに必要です。

使い方
import { ReactiveFormsModule } from "@angular/forms";

RouterModule

SPA(Single Page Application)を作る際に使います。

使い方
import { RouterModule } from "@angular/router";

HttpClientModule

サーバとHTTPでやり取りするの使います。

使い方
import { HttpClientModule } from "@angular/common/http";
1
3
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
1
3