28 lines
873 B
TypeScript
28 lines
873 B
TypeScript
|
|
import { PageLoadingComponent } from '@/shared/components/page-loading.component';
|
||
|
|
import { Component, computed, inject, signal } from '@angular/core';
|
||
|
|
import { ActivatedRoute, RouterOutlet } from '@angular/router';
|
||
|
|
import { ConsumerStore } from '../store/consumer.store';
|
||
|
|
|
||
|
|
@Component({
|
||
|
|
selector: 'partner-consumer-layout',
|
||
|
|
templateUrl: './layout.component.html',
|
||
|
|
imports: [PageLoadingComponent, RouterOutlet],
|
||
|
|
})
|
||
|
|
export class ConsumerLayoutComponent {
|
||
|
|
private readonly store = inject(ConsumerStore);
|
||
|
|
private readonly route = inject(ActivatedRoute);
|
||
|
|
|
||
|
|
readonly consumerId = signal<string>(this.route.snapshot.paramMap.get('consumerId')!);
|
||
|
|
|
||
|
|
readonly loading = computed(() => this.store.loading());
|
||
|
|
readonly consumer = computed(() => this.store.entity());
|
||
|
|
|
||
|
|
getData() {
|
||
|
|
this.store.getData(this.consumerId());
|
||
|
|
}
|
||
|
|
|
||
|
|
ngOnInit() {
|
||
|
|
this.getData();
|
||
|
|
}
|
||
|
|
}
|