Moving to strict.
Create form has now moved to constructor and route data subscribe is type safe.
This commit is contained in:
@ -26,10 +26,6 @@ export class RoleDetailComponent implements OnInit, AfterViewInit {
|
||||
private dialog: MatDialog,
|
||||
private ser: RoleService,
|
||||
) {
|
||||
this.createForm();
|
||||
}
|
||||
|
||||
createForm() {
|
||||
this.form = this.fb.group({
|
||||
name: '',
|
||||
permissions: this.fb.array([]),
|
||||
@ -37,7 +33,9 @@ export class RoleDetailComponent implements OnInit, AfterViewInit {
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
this.route.data.subscribe((data: { item: Role }) => {
|
||||
this.route.data.subscribe((value) => {
|
||||
const data = value as { item: Role };
|
||||
|
||||
this.item = data.item;
|
||||
this.form.get('name').setValue(this.item.name);
|
||||
this.form.setControl(
|
||||
|
||||
Reference in New Issue
Block a user