You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I want to use CustomButtonComponent and be able to trigger method in the PageComponent. I can trig this.print from typescript file but not when loading config from JSON file. How to acheive this?
{
type: 'button',
templateOptions: {
label: 'Click this guy',
text: 'JSON Only',
btnType: 'info',
onClick: ($event) => this.print() ,
description: 'These can have labels and stuff too if you want....',
},
}
Just imagine you are loading this stackblitz formly configuration from JSON file.
The JSON format does not support functions as data types. I faced a similar issue, where I wanted to save a formly config with a hook function as JSON.
Question
I want to use CustomButtonComponent and be able to trigger method in the PageComponent. I can trig this.print from typescript file but not when loading config from JSON file. How to acheive this?
{
type: 'button',
templateOptions: {
label: 'Click this guy',
text: 'JSON Only',
btnType: 'info',
onClick: ($event) => this.print() ,
description: 'These can have labels and stuff too if you want....',
},
}
Just imagine you are loading this stackblitz formly configuration from JSON file.
https://stackblitz.com/edit/angular-ngxformly-button-34pyo7?file=app%2Fapp.component.ts,app%2Fapp.module.ts,app%2Fbutton-type.component.ts
The text was updated successfully, but these errors were encountered: