Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
ngOnInit() {
let addressInfo = new AddressInfo();
let formBuilderConfiguration = new FormBuilderConfiguration();
this.http.get('assets/examples/reactive-form-validators/decorators/alpha/dynamic/dynamic.json?v=' + environment.appVersion).subscribe(dynamic => {
formBuilderConfiguration.dynamicValidation = JSON.parse(JSON.stringify(dynamic));
this.addressInfoFormGroup = this.formBuilder.formGroup(addressInfo,formBuilderConfiguration);
})
}
}
ngOnInit() {
let formBuilderConfiguration = new FormBuilderConfiguration();
this.http.get('assets/examples/reactive-form-validators/validators/digit/dynamic/dynamic.json?v='+environment.appVersion).subscribe(dynamic => {
formBuilderConfiguration.dynamicValidation = JSON.parse(JSON.stringify(dynamic));
var user = { age:'', phoneNumber:'', faxNumber:'', mobileNumber:'', }
this.userFormGroup = this.formBuilder.group(user,formBuilderConfiguration);
})
}
}
ngOnInit() {
let formBuilderConfiguration = new FormBuilderConfiguration();
formBuilderConfiguration.dynamicValidation = {
memberAge : {
greaterThanEqualTo : {fieldName:'age',conditionalExpression:'x => x.age >= 18 ',}
},
otherAge : {
greaterThanEqualTo : {fieldName:'age',message:'Please enter number greater than or equal to 1.',}
},
};
var user = { age:'', voterAge:'', memberAge:'', otherAge:'', }
this.userFormGroup = this.formBuilder.group(user,formBuilderConfiguration);
}
}
ngOnInit() {
let user = new User();
let formBuilderConfiguration = new FormBuilderConfiguration();
this.http.get('assets/examples/reactive-form-validators/decorators/lowerCase/dynamic/dynamic.json?v=' + environment.appVersion).subscribe(dynamic => {
formBuilderConfiguration.dynamicValidation = JSON.parse(JSON.stringify(dynamic));
this.userFormGroup = this.formBuilder.formGroup(user,formBuilderConfiguration);
})
}
}
ngOnInit() {
let formBuilderConfiguration = new FormBuilderConfiguration();
this.http.get('assets/examples/reactive-form-validators/validators/password/dynamic/dynamic.json?v='+environment.appVersion).subscribe(dynamic => {
formBuilderConfiguration.dynamicValidation = JSON.parse(JSON.stringify(dynamic));
var loginInfo = { newPassword:'', oldPassword:'', }
this.loginInfoFormGroup = this.formBuilder.group(loginInfo,formBuilderConfiguration);
})
}
}
ngOnInit() {
let accountInfo = new AccountInfo();
let formBuilderConfiguration = new FormBuilderConfiguration();
formBuilderConfiguration.dynamicValidation = {
password : {
different : {fieldName:"firstName",message:'{{0}} is same as firstName',}
},
userName : {
different : {fieldName:"firstName",conditionalExpression:'x => x.firstName == "Bharat"',}
}, };
this.accountInfoFormGroup = this.formBuilder.formGroup(accountInfo,formBuilderConfiguration);
}
}
ngOnInit() {
let formBuilderConfiguration = new FormBuilderConfiguration();
this.http.get('assets/examples/reactive-form-validators/validators/minDate/dynamic/dynamic.json?v='+environment.appVersion).subscribe(dynamic => {
formBuilderConfiguration.dynamicValidation = JSON.parse(JSON.stringify(dynamic));
var user = { userName:'', allocationDate:'', birthDate:'', admissionDate:'', registrationDate:'', enrollmentDate:'', lastRegistrationDate:'', confirmationDate:'', }
this.userFormGroup = this.formBuilder.group(user,formBuilderConfiguration);
})
}
}
ngOnInit() {
let user = new User();
let formBuilderConfiguration = new FormBuilderConfiguration();
formBuilderConfiguration.dynamicValidation = {
admissionDate : {
minDate : {value:new Date(2018,7,30),conditionalExpression:'x => x.userName == "Bharat"',}
},
registrationDate : {
minDate : {value:new Date(2018,7,30),message:'{{0}} exceeds the Minimum Date Limit',}
}, };
this.userFormGroup = this.formBuilder.formGroup(user,formBuilderConfiguration);
}
}
ngOnInit() {
let formBuilderConfiguration = new FormBuilderConfiguration();
this.http.get('assets/examples/reactive-form-validators/validators/contains/dynamic/dynamic.json?v='+environment.appVersion).subscribe(dynamic => {
formBuilderConfiguration.dynamicValidation = JSON.parse(JSON.stringify(dynamic));
var user = { emailAddress:'', businessEmailAddress:'', recoveryEmailAddress:'', otherEmailAddress:'', }
this.userFormGroup = this.formBuilder.group(user,formBuilderConfiguration);
})
}
}
ngOnInit() {
let formBuilderConfiguration = new FormBuilderConfiguration();
this.http.get('assets/examples/reactive-form-validators/validators/ascii/dynamic/dynamic.json').subscribe(dynamic => {
formBuilderConfiguration.dynamicValidation = JSON.parse(JSON.stringify(dynamic));
var user = { language:'', numberAsciiCode:'', alphabetAsciiCode:'', specialCharAsciiCode:'', }
this.userFormGroup = this.formBuilder.group(user,formBuilderConfiguration);
})
}
}