Skip to content

Instantly share code, notes, and snippets.

View ajayojha's full-sized avatar
⏱️
Developing Something New 😄

Ajay Ojha ajayojha

⏱️
Developing Something New 😄
View GitHub Profile
import { alpha, required, minLength } from "@rxweb/reactive-forms";
export class User {
private _firstName: string = "";
private _lastName: string = "";
fullName!: string;
@required()
<input type="text" id="userName" class="form-control" name="userName"
v-model="userFormGroup.props.userName" />
<small class="form-text text-danger">{{userFormGroup.controls.userName.errorMessage}}</small>
<div class="form-group">
<label>User Name</label>
<input type="text" id="userName" class="form-control" name="userName"
v-model="userFormGroup.props.userName" />
<div>
import { Component, Prop, Vue } from 'vue-property-decorator';
import { RxFormBuilder, IFormGroup } from "@rxweb/reactive-forms"
import { User } from "../models/user"
@Component
export default class SignUp extends Vue {
userFormGroup!: IFormGroup<User>;
formBuilder: RxFormBuilder = new RxFormBuilder();
import { ReactiveFormConfig, ClientLibrary } from '@rxweb/reactive-forms';
ReactiveFormConfig.clientLib = ClientLibrary.Vue;
ReactiveFormConfig.set({
validationMessage: {
required: "This Field is required",
.....
}
});
selectUser(user) {
// the user object json would be like : {name:"John" }
let message = RxTranslateModule.tranlate(this.multilingualContent.text.selectedRecord, user);
}
{
"selectedRecord": "You have selected record of '{name}'"
}
{
"conditionalText": "this.freeText == 'India' ? this.multilingualContent.indiaInfo : this.multilingualContent.worldInfo",
}
{
"indiaInfo": "India, officially the Republic of India, is a country in South Asia. It is the seventh-largest country by area, the second-most populous country, and the most populous democracy in the world.",
"worldInfo": "The World is Planet Earth and all life on it, including human civilization. In a philosophical context, the world is the whole of the physical Universe, or an ontological world.",
}
{
"userCityInfo": "The selected user City Name is: {{user.address.cityName}}"
}