Skip to content

Commit

Permalink
feat(angular16): set all inputs to required
Browse files Browse the repository at this point in the history
  • Loading branch information
Ismaestro committed Sep 18, 2023
1 parent 0198bef commit 02c146b
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ import { FormControl, FormGroupDirective } from '@angular/forms';
changeDetection: ChangeDetectionStrategy.OnPush,
})
export class FormErrorsComponent implements DoCheck {
@Input() formRef: FormGroupDirective | undefined;
@Input() control: FormControl | undefined;
@Input({ required: true }) formRef: FormGroupDirective | undefined;
@Input({ required: true }) control: FormControl | undefined;

constructor(private changeDetectorRef: ChangeDetectorRef) {}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import { User } from '~modules/user/shared/user.model';
imports: [RouterModule, NgIf],
})
export class SidebarComponent implements OnInit, OnDestroy {
@Input() user: User | undefined;
@Input({ required: true }) user: User | undefined;

userRoutes: typeof userRoutes;
currentUrl: string;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import { userRoutes } from '~modules/user/shared/user-routes';
imports: [ReactiveFormsModule, NgIf],
})
export class ChangeLanguageComponent implements OnInit, OnDestroy {
@Input() user: User | undefined;
@Input({ required: true }) user: User | undefined;

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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ import { TrimDirective } from '~modules/shared/directives/trim.directive';
imports: [ReactiveFormsModule, FormErrorsComponent, NgIf, FormsModule, TrimDirective],
})
export class DeleteAccountComponent implements OnDestroy {
@Input() user: User | undefined;
@Input({ required: true }) user: User | undefined;

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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ import { NetworkHelperService } from '~modules/shared/services/network-helper.se
imports: [ReactiveFormsModule, TrimDirective, FormErrorsComponent, LowercaseDirective, NgIf],
})
export class EditProfileComponent implements OnInit, OnDestroy {
@Input() user: User | undefined;
@Input({ required: true }) user: User | undefined;

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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,10 @@ import { Modal } from 'bootstrap';
imports: [NgIf, FormErrorsComponent, ReactiveFormsModule, NgClass, NgForOf],
})
export class HeroModalComponent implements OnChanges, OnDestroy {
@Input() modal: Modal | undefined;
@Input() user: User | undefined;
@Input() heroSelected: Hero | undefined;
@Input() heroesList: Hero[] | undefined;
@Input({ required: true }) modal: Modal | undefined;
@Input({ required: true }) user: User | undefined;
@Input({ required: true }) heroSelected: Hero | undefined;
@Input({ required: true }) heroesList: Hero[] | undefined;

destroy$: Subject<boolean> = new Subject<boolean>();
translations: typeof translations;
Expand Down

0 comments on commit 02c146b

Please sign in to comment.