How to use the @rxweb/reactive-form-validators.NumericValueType.NegativeNumber function in @rxweb/reactive-form-validators

To help you get started, we’ve selected a few @rxweb/reactive-form-validators examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github rxweb / rxweb / test / reactive-form-validators / validator / numeric.validator.spec.ts View on Github external
() => { 
            expect(RxwebValidators.numeric({acceptValue:NumericValueType.NegativeNumber})(new FormControl(-12))).toBeNull(); 
          });
github rxweb / rxweb / test / reactive-form-validators / validator / numeric.validator.spec.ts View on Github external
() => { 
            expect(RxwebValidators.numeric({acceptValue:NumericValueType.NegativeNumber})(new FormControl(12))).toEqual({'numeric':{ message: 'Enter a valid numeric digit.', refValues: [ 12 ] } }); 
          });
github rxweb / rxweb / rxwebio / src / assets / examples / reactive-form-validators / validators / numeric / complete / numeric-complete.component.ts View on Github external
ngOnInit() {
        this.userInfoFormGroup = this.formBuilder.group({
            dataType:['',], 
            negativeNumber:['', RxwebValidators.numeric({acceptValue:NumericValueType.NegativeNumber })], 
            decimalNumber:['', RxwebValidators.numeric({allowDecimal:true })], 
            integerNumber:['', RxwebValidators.numeric({acceptValue:NumericValueType.PositiveNumber  ,conditionalExpression:(x,y) => x.dataType == "Integer"  })], 
            realNumber:['', RxwebValidators.numeric({acceptValue:NumericValueType.Both  ,conditionalExpression:'x => x.dataType == "Real"' })], 
            positiveNumber:['', RxwebValidators.numeric({message:'{{0}} is not a positive number' })], 
        });
    }
}
github rxweb / rxweb / rxweb.io / src / assets / examples / reactive-form-validators / validators / numeric / complete / numeric-complete.component.ts View on Github external
ngOnInit() {
        this.userInfoFormGroup = this.formBuilder.group({
            dataType:['',], 
            integerNumber:['', RxwebValidators.numeric({acceptValue:NumericValueType.PositiveNumber  ,allowDecimal:false  ,conditionalExpression:(x,y) => x.dataType == "Number"  })], 
            realNumber:['', RxwebValidators.numeric({acceptValue:NumericValueType.Both  ,allowDecimal:false  ,conditionalExpression:'x => x.dataType == "Number"' })], 
            negativeNumber:['', RxwebValidators.numeric({acceptValue:NumericValueType.NegativeNumber  ,allowDecimal:true  ,message:'{{0}} is not a negative number' })], 
        });
    }
}
github rxweb / rxweb / rxweb.io / src / assets / examples / reactive-form-validators / validators / numeric / acceptValue / numeric-accept-value.component.ts View on Github external
ngOnInit() {
        this.userInfoFormGroup = this.formBuilder.group({
            negativeNumber:['', RxwebValidators.numeric({acceptValue:NumericValueType.NegativeNumber  ,allowDecimal:true  ,message:'{{0}} is not a negative number' })], 
        });
    }
}
github rxweb / rxweb / rxwebio / src / assets / examples / reactive-form-validators / decorators / numeric / complete / user-info.model.ts View on Github external
import {  numeric,prop, NumericValueType, } from   "@rxweb/reactive-form-validators"   

export class UserInfo {

	@prop()
	dataType: string;

	@numeric({acceptValue:NumericValueType.NegativeNumber }) 
	negativeNumber: number;
	
	
	

	@numeric({allowDecimal:true }) 
	decimalNumber: number;
	
	
	

	//If you want to apply conditional expression of type 'function'
	@numeric({acceptValue:NumericValueType.PositiveNumber  ,conditionalExpression:(x,y) => x.dataType == "Integer"  }) 
	integerNumber: number;
github rxweb / rxweb / rxweb.io / src / assets / examples / reactive-form-validators / decorators / numeric / complete / user-info.model.ts View on Github external
import {  numeric,prop, NumericValueType, } from "@rxweb/reactive-form-validators"

export class UserInfo {

	@prop()
	dataType: string;

	//If you want to apply conditional expression of type 'function'
	@numeric({acceptValue:NumericValueType.PositiveNumber  ,allowDecimal:false  ,conditionalExpression:(x,y) => x.dataType == "Number"  }) 
	integerNumber: number;

	//If you want to apply conditional expression of type 'string'
	@numeric({acceptValue:NumericValueType.Both  ,allowDecimal:false  ,conditionalExpression:'x => x.dataType == "Number"' }) 
	realNumber: number;

	@numeric({acceptValue:NumericValueType.NegativeNumber  ,allowDecimal:true  ,message:'{{0}} is not a negative number' }) 
	negativeNumber: number;

}
github rxweb / rxweb / rxweb.io / src / assets / examples / reactive-form-validators / decorators / numeric / message / user-info.model.ts View on Github external
import {  numeric,prop, NumericValueType, } from "@rxweb/reactive-form-validators"

export class UserInfo {

	@numeric({acceptValue:NumericValueType.NegativeNumber  ,message:'{{0}} is not a negative number' }) 
	negativeNumber: number;

}
github rxweb / rxweb / rxwebio / src / assets / examples / reactive-form-validators / template-driven / validation-decorators / numeric / acceptValue / user-info.model.ts View on Github external
import {  numeric, NumericValueType, } from   "@rxweb/reactive-form-validators"   

export class UserInfo {

	@numeric({acceptValue:NumericValueType.NegativeNumber }) 
	negativeNumber: number;
	
	
	

}

@rxweb/reactive-form-validators

[![Build Status](https://dev.azure.com/ajayojha/rxweb/_apis/build/status/rxweb-CI?branchName=master)](https://dev.azure.com/ajayojha/rxweb/_build/latest?definitionId=39&branchName=master) [![Gitter](https://badges.gitter.im/rx-web/Lobby.svg)](https://git

MIT
Latest version published 1 year ago

Package Health Score

57 / 100
Full package analysis