Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
() => {
let formBuilder = new FormBuilder();
let formGroup = formBuilder.group({
'dataType': 'Integer',
'integerNumber': -15
});
expect(RxwebValidators.numeric({ acceptValue:NumericValueType.PositiveNumber,conditionalExpression: (x, y) => x.dataType == "Integer" })(formGroup.controls.integerNumber)).toEqual({ 'numeric': { message: 'Enter a valid numeric digit.', refValues: [-15] } });
});
ngOnInit() {
this.userInfoFormGroup = this.formBuilder.group({
integerNumber:['', RxwebValidators.numeric({acceptValue:NumericValueType.PositiveNumber ,allowDecimal:false })],
});
}
}
ngOnInit() {
this.userInfoFormGroup = this.formBuilder.group({
dataType:['',],
realNumber:['', RxwebValidators.numeric({acceptValue:NumericValueType.Both ,conditionalExpression:'x => x.dataType == "Real"' })],
integerNumber:['', RxwebValidators.numeric({acceptValue:NumericValueType.PositiveNumber ,conditionalExpression:(x,y) => x.dataType == "Positive" })],
});
}
}
ngOnInit() {
this.userInfoFormGroup = this.formBuilder.group({
negativeNumber:['', RxwebValidators.numeric({acceptValue:NumericValueType.NegativeNumber })],
});
}
}
ngOnInit() {
this.userInfoFormGroup = this.formBuilder.group({
decimalNumber:['', RxwebValidators.numeric({allowDecimal:true })],
});
}
}
ngOnInit() {
this.userInfoFormGroup = this.formBuilder.group({
positiveNumber:['', RxwebValidators.numeric({message:'{{0}} is not a positive number' })],
});
}
}
ngOnInit() {
this.userInfoFormGroup = this.formBuilder.group({
negativeNumber:['', RxwebValidators.numeric({acceptValue:NumericValueType.NegativeNumber ,allowDecimal:true ,message:'{{0}} is not a negative number' })],
});
}
}
ngOnInit() {
this.userInfoFormGroup = this.formBuilder.group({
negativeNumber:['', RxwebValidators.numeric({acceptValue:NumericValueType.NegativeNumber ,message:'{{0}} is not a negative number' })],
});
}
}