Angular To doリスト作成
解決したいこと
AngularにてTodoアプリを作っています。
オブジェクトはnullである可能性がありますと表示されエラーが解決できません。
よろしければ教えていただけるとありがたいです。
onSaveTodoItem(): void {
const item: any = {
title: this.todoForm.get('title').value,
isComplete: false,
description: null,
date: null
};
if (this.hasDetail) {
item.description = this.todoForm.get('description').value;
item.date = this.todoForm.get('date').value;
}
this.itemList.push(item);
this.clearForm();
console.log(this.itemList);
}
0 likes
