import { Component, ViewChild, ViewContainerRef } from '@angular/core'; import { FieldWrapper } from '../../core/core'; @Component({ selector: 'formly-wrapper-addons', template: `
{{to.addonLeft.text}}
{{to.addonRight.text}}
`, }) export class FormlyWrapperAddons extends FieldWrapper { @ViewChild('fieldComponent', {read: ViewContainerRef}) fieldComponent: ViewContainerRef; addonRightClick($event) { if (this.to['addonRight'].onClick) { this.to['addonRight'].onClick(this.to, this, $event); } } addonLeftClick($event) { if (this.to['addonLeft'].onClick) { this.to['addonLeft'].onClick(this.to, this, $event); } } }