Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
ダミー JSON データ Typescript ファイル => ダミー JSON データファイルへの移行 2a27139
Note
API 用モックとは?
API 用モックとは、実際のAPIと同様に振る舞う、テスト用の仮想的なAPIのことです
ダミー JSON データファイル用
ディレクトリ
の作成ダミー JSON データファイル用の作成
新規作成用(create) json
削除用(delete) json
一覧取得用(get all) json
個別取得用(get id) json
更新用(update) json
mock API 用 モデル追加・変更 7fd5c18
memo
.ts)は、MySQL のテーブル構造に合わせて作成します。memo-ui
.ts)は、上記API service 用 モデル定義と項目が同じ為、モデルを継承します。
mock API 用 service 追加 0c1c957
Note
再利用可能なコードの集まり(ファイル)です。
API service 用ディレクトリの作成
mock API service の作成
Note
ng generate
書式:ng
generate
生成種類 生成名前 オプション書式:ng
g
生成種類 生成名前 オプションnpx は、Angular CLI が
グローバルインストールされていない
時に使います。生成種類(schematic)については、ng generate を参照
実行例:npx ng g s api --path=./src/app/shared/service
REST API の CRUD(Create, Read, Update, Delete)の定義
Note
getAll:メモ一覧取得
get:メモ取得
cretae:メモ作成
update:メモ更新
delete:メモ削除
HttpClient を DI 692a83e
Note