libs/playground-test-bbs/src/lib/pgr-contact-us/pgr-contact-us.component.ts
Properties |
label | |
Type |
string
|
import { AbstractBuildingBlock, createBuildingBlockProvider } from '@allianz/taly-core';
import { ChangeDetectorRef, Component, forwardRef, inject } from '@angular/core';
export interface PgrContactUsResources {
label: string;
}
@Component({
selector: 'bb-pgr-contact-us',
template: `<button
class="nx-margin-bottom-0"
nxButton="secondary small"
type="button"
(click)="onClicked()"
>
{{ label }}
<span *aclTag="'button-icon'" class="nx-margin-left-2xs">🐛</span>
</button>`,
providers: [createBuildingBlockProvider(forwardRef(() => PgrContactUsComponent))],
standalone: false
})
export class PgrContactUsComponent extends AbstractBuildingBlock<undefined, PgrContactUsResources> {
label = '';
private cdr = inject(ChangeDetectorRef);
onClicked() {
console.log(`Thanks for contacting us!`);
}
override setResources(data: PgrContactUsResources): void {
this.label = data.label;
this.cdr.detectChanges();
}
}