Skip to content

Commit 02c146b

Browse files
committed
feat(angular16): set all inputs to required
1 parent 0198bef commit 02c146b

File tree

6 files changed

+10
-10
lines changed

6 files changed

+10
-10
lines changed

src/app/modules/shared/components/form-errors/form-errors.component.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ import { FormControl, FormGroupDirective } from '@angular/forms';
1616
changeDetection: ChangeDetectionStrategy.OnPush,
1717
})
1818
export class FormErrorsComponent implements DoCheck {
19-
@Input() formRef: FormGroupDirective | undefined;
20-
@Input() control: FormControl | undefined;
19+
@Input({ required: true }) formRef: FormGroupDirective | undefined;
20+
@Input({ required: true }) control: FormControl | undefined;
2121

2222
constructor(private changeDetectorRef: ChangeDetectorRef) {}
2323

src/app/modules/shared/components/sidebar/sidebar.component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ import { User } from '~modules/user/shared/user.model';
2222
imports: [RouterModule, NgIf],
2323
})
2424
export class SidebarComponent implements OnInit, OnDestroy {
25-
@Input() user: User | undefined;
25+
@Input({ required: true }) user: User | undefined;
2626

2727
userRoutes: typeof userRoutes;
2828
currentUrl: string;

src/app/modules/user/components/change-language/change-language.component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ import { userRoutes } from '~modules/user/shared/user-routes';
2020
imports: [ReactiveFormsModule, NgIf],
2121
})
2222
export class ChangeLanguageComponent implements OnInit, OnDestroy {
23-
@Input() user: User | undefined;
23+
@Input({ required: true }) user: User | undefined;
2424

2525
destroy$: Subject<boolean> = new Subject<boolean>();
2626

src/app/modules/user/components/delete-account/delete-account.component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ import { TrimDirective } from '~modules/shared/directives/trim.directive';
4040
imports: [ReactiveFormsModule, FormErrorsComponent, NgIf, FormsModule, TrimDirective],
4141
})
4242
export class DeleteAccountComponent implements OnDestroy {
43-
@Input() user: User | undefined;
43+
@Input({ required: true }) user: User | undefined;
4444

4545
@ViewChild('closeModal') closeModal: ElementRef | undefined;
4646

src/app/modules/user/components/edit-profile/edit-profile.component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ import { NetworkHelperService } from '~modules/shared/services/network-helper.se
3232
imports: [ReactiveFormsModule, TrimDirective, FormErrorsComponent, LowercaseDirective, NgIf],
3333
})
3434
export class EditProfileComponent implements OnInit, OnDestroy {
35-
@Input() user: User | undefined;
35+
@Input({ required: true }) user: User | undefined;
3636

3737
destroy$: Subject<boolean> = new Subject<boolean>();
3838

src/app/modules/user/components/hero-modal/hero-modal.component.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,10 @@ import { Modal } from 'bootstrap';
3131
imports: [NgIf, FormErrorsComponent, ReactiveFormsModule, NgClass, NgForOf],
3232
})
3333
export class HeroModalComponent implements OnChanges, OnDestroy {
34-
@Input() modal: Modal | undefined;
35-
@Input() user: User | undefined;
36-
@Input() heroSelected: Hero | undefined;
37-
@Input() heroesList: Hero[] | undefined;
34+
@Input({ required: true }) modal: Modal | undefined;
35+
@Input({ required: true }) user: User | undefined;
36+
@Input({ required: true }) heroSelected: Hero | undefined;
37+
@Input({ required: true }) heroesList: Hero[] | undefined;
3838

3939
destroy$: Subject<boolean> = new Subject<boolean>();
4040
translations: typeof translations;

0 commit comments

Comments
 (0)