“Edit / Delete” button for each row & header column is ‘Action’ in the md-table component

You are on the right track, you just need to add an actions item to displayedColumns list: displayedColumns = [“username”, “email”, “userFirstName” … , “actions”]; and: <ng-container cdkColumnDef=”actions”> <md-header-cell > Actions </md-header-cell> <md-cell *cdkCellDef=”let row” > <button md-raised-button >Edit</button> </md-cell> </ng-container>

Angular form updateValueAndValidity of all children controls

I had the same situation for me to update FormGroup | FormArray at nested level controls. check this out(worked for me): /** * Re-calculates the value and validation status of the entire controls tree. */ function updateTreeValidity(group: FormGroup | FormArray): void { Object.keys(group.controls).forEach((key: string) => { const abstractControl = group.controls[key]; if (abstractControl instanceof FormGroup || … Read more

Angular2 Reactive Forms formControl for radio buttons

In your component, define your radio button as part of your form: export class MyComponent { form: FormGroup; constructor(fb: FormBuilder){ this.form = fb.group({ gender: “” }); } } In your component HTML, construct your form: <div class=”form-group”> <label>Please select your gender</label> <div class=”row”> <label class=”md-check”> <input type=”radio” value=”female” name=”gender” formControlName=”gender”> Female </label> <label class=”md-check”> <input … Read more

angular 5 template forms detect change of form validity status

If you want to get only the status and not the value you can use statusChanges: export class Component { @ViewChild(‘myForm’) myForm; this.myForm.statusChanges.subscribe( result => console.log(result) ); } If you even want data changes, you can subscribe to the valueChanges of the form and check the status of the form using this.myForm.status: export class Component … Read more