update angular
This commit is contained in:
@@ -2,11 +2,11 @@
|
||||
<div [formGroup]="form" class="split">
|
||||
<mat-form-field appearance="outline">
|
||||
<mat-label>Nummer</mat-label>
|
||||
<input formControlName="number" matInput/>
|
||||
<input formControlName="number" matInput />
|
||||
</mat-form-field>
|
||||
<mat-form-field appearance="outline">
|
||||
<mat-label>Titel</mat-label>
|
||||
<input autofocus formControlName="title" matInput/>
|
||||
<input autofocus formControlName="title" matInput />
|
||||
</mat-form-field>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@ describe('NewComponent', () => {
|
||||
void TestBed.configureTestingModule({
|
||||
declarations: [NewComponent],
|
||||
}).compileComponents();
|
||||
})
|
||||
}),
|
||||
);
|
||||
|
||||
beforeEach(() => {
|
||||
|
||||
@@ -10,6 +10,7 @@ import {Subscription} from 'rxjs';
|
||||
selector: 'app-new',
|
||||
templateUrl: './new.component.html',
|
||||
styleUrls: ['./new.component.less'],
|
||||
standalone: false,
|
||||
})
|
||||
export class NewComponent implements OnInit, OnDestroy {
|
||||
public faSave = faSave;
|
||||
@@ -17,8 +18,10 @@ export class NewComponent implements OnInit, OnDestroy {
|
||||
number: new UntypedFormControl(null, Validators.required),
|
||||
title: new UntypedFormControl(null, Validators.required),
|
||||
});
|
||||
private subs: Subscription[] = [];
|
||||
|
||||
public constructor(private songService: SongService, private router: Router) {}
|
||||
public constructor(private songService: SongService, private router: Router) {
|
||||
}
|
||||
|
||||
public ngOnInit(): void {
|
||||
this.form.reset();
|
||||
@@ -27,11 +30,10 @@ export class NewComponent implements OnInit, OnDestroy {
|
||||
this.songService.list$().subscribe(songs => {
|
||||
const freeSongnumber = this.getFreeSongNumber(songs);
|
||||
this.form.controls.number.setValue(freeSongnumber);
|
||||
})
|
||||
}),
|
||||
);
|
||||
}
|
||||
|
||||
private subs: Subscription[] = [];
|
||||
public ngOnDestroy(): void {
|
||||
this.subs.forEach(_ => _.unsubscribe());
|
||||
}
|
||||
|
||||
@@ -13,4 +13,5 @@ import {AutofocusModule} from '../../../../widget-modules/directives/autofocus/a
|
||||
declarations: [NewComponent],
|
||||
imports: [CommonModule, CardModule, ReactiveFormsModule, MatFormFieldModule, MatInputModule, ButtonRowModule, ButtonModule, AutofocusModule],
|
||||
})
|
||||
export class NewModule {}
|
||||
export class NewModule {
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user