Chore:
Upgraded to Angular 14
This commit is contained in:
@ -1,5 +1,10 @@
|
||||
import { AfterViewInit, Component, ElementRef, OnInit, ViewChild } from '@angular/core';
|
||||
import { AbstractControl, FormArray, FormBuilder, FormGroup } from '@angular/forms';
|
||||
import {
|
||||
AbstractControl,
|
||||
UntypedFormArray,
|
||||
UntypedFormBuilder,
|
||||
UntypedFormGroup,
|
||||
} from '@angular/forms';
|
||||
import { MatDialog } from '@angular/material/dialog';
|
||||
import { ActivatedRoute, Router } from '@angular/router';
|
||||
|
||||
@ -15,14 +20,14 @@ import { UserService } from '../user.service';
|
||||
})
|
||||
export class UserDetailComponent implements OnInit, AfterViewInit {
|
||||
@ViewChild('nameElement', { static: true }) nameElement?: ElementRef;
|
||||
form: FormGroup;
|
||||
form: UntypedFormGroup;
|
||||
item: User = new User();
|
||||
hide: boolean;
|
||||
|
||||
constructor(
|
||||
private route: ActivatedRoute,
|
||||
private router: Router,
|
||||
private fb: FormBuilder,
|
||||
private fb: UntypedFormBuilder,
|
||||
private toaster: ToasterService,
|
||||
private dialog: MatDialog,
|
||||
private ser: UserService,
|
||||
@ -116,7 +121,7 @@ export class UserDetailComponent implements OnInit, AfterViewInit {
|
||||
this.item.name = formModel.name;
|
||||
this.item.password = formModel.password;
|
||||
this.item.lockedOut = formModel.lockedOut;
|
||||
const array = this.form.get('roles') as FormArray;
|
||||
const array = this.form.get('roles') as UntypedFormArray;
|
||||
if (this.item.roles !== undefined) {
|
||||
this.item.roles.forEach((item, index) => {
|
||||
item.enabled = array.controls[index].value.role;
|
||||
|
||||
Reference in New Issue
Block a user