1
votes

I cloned: https://github.com/johnpapa/angular-ngrx-data and added a new component named alerts. However when I click "add" on the alerts:

  1. It's showing the "id" field while it's not showing in heroes.
  2. Save button is disabled while in heroes it's enabled.

Can anyone tell what was is the difference between alerts component and heroes component that causes these problems?

see my source code here: ngrx-data-alerts-component

enter image description here

1

1 Answers

2
votes

In the alert-detail.component.html you wrongly named your formControlName to symbol instead of name wich is a required field name: ['', Validators.required].

Change line 15 to this :

<input matInput formControlName="name" placeholder="name" #name
              (keyup.esc)="close()" (keyup.enter)="saveAlert()">

Here is a running fix.