42 lines
1.5 KiB
TypeScript
42 lines
1.5 KiB
TypeScript
import { CommonModule } from '@angular/common';
|
|
import { afterNextRender, Component, inject, viewChild } from '@angular/core';
|
|
import { AngularMaterialModule } from '../../shared/module/angular-material.module';
|
|
import { MatAccordion } from '@angular/material/expansion';
|
|
import { UserPreferences } from '../../core/models/user-preference';
|
|
import { ActivatedRoute } from '@angular/router';
|
|
import { UserPreferencesService } from '../../core/services/user-preference.service';
|
|
import { BasicDetailComponent } from '../basic-details/basic-details.component';
|
|
import { ContactsComponent } from '../contacts/contacts.component';
|
|
|
|
@Component({
|
|
selector: 'app-edit-holder',
|
|
imports: [AngularMaterialModule, CommonModule, BasicDetailComponent, ContactsComponent],
|
|
templateUrl: './edit-holder.component.html',
|
|
styleUrl: './edit-holder.component.scss'
|
|
})
|
|
export class EditHolderComponent {
|
|
accordion = viewChild.required(MatAccordion);
|
|
isEditMode = true;
|
|
holderid = 0;
|
|
holderName: string | null = null;
|
|
userPreferences: UserPreferences;
|
|
|
|
private route = inject(ActivatedRoute);
|
|
|
|
constructor(userPrefenceService: UserPreferencesService) {
|
|
this.userPreferences = userPrefenceService.getPreferences();
|
|
afterNextRender(() => {
|
|
this.accordion().openAll();
|
|
});
|
|
}
|
|
|
|
ngOnInit(): void {
|
|
const idParam = this.route.snapshot.paramMap.get('holderid');
|
|
this.holderid = idParam ? parseInt(idParam, 10) : 0;
|
|
}
|
|
|
|
onHolderNameUpdate(event: string): void {
|
|
this.holderName = event;
|
|
}
|
|
}
|