Files
ISA-Frontend/apps/shared/modals/purchase-options-modal/src/lib/purchase-options-tile/in-store-purchase-options-tile.component.ts
Lorenz Hilpert f4c1c3dd7f Merged PR 1513: Kaufoptionen
Related work items: #3365, #3366, #3385, #3386, #3391
2023-03-20 17:11:53 +00:00

30 lines
1.2 KiB
TypeScript

import { CommonModule } from '@angular/common';
import { Component, ChangeDetectionStrategy, ChangeDetectorRef } from '@angular/core';
import { FormsModule } from '@angular/forms';
import { BranchSelectorComponent } from '@shared/components/branch-selector';
import { BranchNamePipe } from '@shared/pipes/branch';
import { BranchDTO } from '@swagger/checkout';
import { UiIconModule } from '@ui/icon';
import { PurchaseOptionsStore } from '../store';
import { BasePurchaseOptionDirective } from './base-purchase-option.directive';
@Component({
selector: 'app-in-store-purchase-options-tile',
templateUrl: 'in-store-purchase-options-tile.component.html',
styleUrls: ['purchase-options-tile.component.css'],
changeDetection: ChangeDetectionStrategy.OnPush,
standalone: true,
imports: [CommonModule, UiIconModule, BranchSelectorComponent, FormsModule, BranchNamePipe],
})
export class InStorePurchaseOptionTileComponent extends BasePurchaseOptionDirective {
inStoreBranch$ = this.store.inStoreBranch$;
constructor(protected store: PurchaseOptionsStore, protected cdr: ChangeDetectorRef) {
super('in-store');
}
setInStoreBranch(branch?: BranchDTO) {
this.store.setInStoreBranch(branch);
}
}