Switched on the @typescript-eslint/no-non-null-assertion rule in eslint.
Fixed the errors it threw up.
This commit is contained in:
@ -103,10 +103,10 @@ export class RoleDetailComponent implements OnInit, AfterViewInit {
|
||||
|
||||
getItem(): Role {
|
||||
const formModel = this.form.value;
|
||||
this.item.name = formModel.name!;
|
||||
this.item.name = formModel.name ?? '';
|
||||
const array = this.form.controls.permissions;
|
||||
this.item.permissions.forEach((item, index) => {
|
||||
item.enabled = array.controls[index].value.permission!;
|
||||
item.enabled = array.controls[index].value.permission ?? false;
|
||||
});
|
||||
return this.item;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user