Skip to content

Instantly share code, notes, and snippets.

@Macadoshis
Created January 4, 2019 10:17
Show Gist options
  • Select an option

  • Save Macadoshis/ff8857403c8af2e85cfdc1105d5b0c7f to your computer and use it in GitHub Desktop.

Select an option

Save Macadoshis/ff8857403c8af2e85cfdc1105d5b0c7f to your computer and use it in GitHub Desktop.
import { Component } from '@angular/core';
import { FieldType } from '@ngx-formly/core';
import { isFunction } from 'util';
@Component({
selector: 'formly-field-button',
templateUrl: './formly-field-button.component.html'
})
export class FormlyFieldButtonComponent extends FieldType {
onClick(): void {
console.info(this.to.type);
console.info(this.to.label);
console.info(this.to.text);
if (isFunction(this.to.onClick)) {
this.to.onClick();
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment