Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
{
validator: (control: AbstractControl) => {
let isValid: boolean = control.value.length <= 2;
return !isValid ? { invalidChips: true } : undefined;
},
},
],
},
];
elementOptions: any[] = [
TdDynamicElement.Input,
TdDynamicType.Number,
TdDynamicElement.Datepicker,
TdDynamicElement.Password,
TdDynamicElement.Textarea,
TdDynamicElement.Slider,
TdDynamicElement.Checkbox,
TdDynamicElement.SlideToggle,
TdDynamicElement.FileInput,
];
showDynamicCode: boolean = false;
type: any;
count: number = 2;
customValidationElements: ITdDynamicElementConfig[] = [
{
name: 'evenElement',
label: 'Even Number',
minLength: 4,
maxLength: 12,
flex: 50,
},
{
name: 'text',
type: TdDynamicType.Text,
required: false,
default: 'Default',
flex: 50,
disabled: true,
},
{
name: 'textarea',
hint: 'this is a textarea hint',
type: TdDynamicElement.Textarea,
required: false,
},
{
name: 'required-password',
label: 'Password Label',
type: TdDynamicElement.Password,
required: true,
},
];
numberElements: ITdDynamicElementConfig[] = [
{
name: 'number',
label: 'Number',
type: TdDynamicType.Number,
required: true,
minLength: 4,
maxLength: 12,
flex: 50,
},
{
name: 'text',
type: TdDynamicType.Text,
required: false,
default: 'Default',
flex: 50,
disabled: true,
},
{
name: 'textarea',
hint: 'this is a textarea hint',
type: TdDynamicElement.Textarea,
required: false,
},
{
name: 'required-password',
label: 'Password Label',
type: TdDynamicElement.Password,
required: true,
},
];
numberElements: ITdDynamicElementConfig[] = [
{
name: 'number',
label: 'Number',
type: TdDynamicType.Number,
required: true,
minLength: 4,
maxLength: 12,
flex: 50,
},
{
name: 'text',
type: TdDynamicType.Text,
required: false,
default: 'Default',
flex: 50,
disabled: true,
},
{
name: 'textarea',
hint: 'this is a textarea hint',
type: TdDynamicElement.Textarea,
required: false,
},
{
name: 'required-password',
label: 'Password Label',
type: TdDynamicElement.Password,
required: true,
},
];
}
{
validator: (control: AbstractControl) => {
const isValid: boolean = control.value.length <= 2;
return !isValid ? { invalidChips: true } : undefined;
},
},
],
},
];
elementOptions: any[] = [
TdDynamicElement.Input,
TdDynamicType.Number,
TdDynamicElement.Datepicker,
TdDynamicElement.Password,
TdDynamicElement.Textarea,
TdDynamicElement.Slider,
TdDynamicElement.Checkbox,
TdDynamicElement.SlideToggle,
TdDynamicElement.FileInput,
];
showDynamicCode: boolean = false;
type: any;
count: number = 2;
customValidationElements: ITdDynamicElementConfig[] = [
{
name: 'evenElement',
label: 'Even Number',