constructor() {
    super();

    let fb = new FormBuilder()
    this.partyForm = fb.group({
      name: ['', Validators.required],
      description: ['', Validators.required],
      location: ['', Validators.required]
    });
  }
Example #2
0
  constructor(private productService: ProductService) {
    this.categories = this.productService.getAllCategories();

    const fb = new FormBuilder();
    this.formModel = fb.group({
      'title': [null, Validators.minLength(3)],
      'price': [null, positiveNumberValidator],
      'category': ['']
    })
  }
 constructor(fb: FormBuilder) {
     this.interviewForm = fb.group({
         interview: fb.group({
             candidate: fb.group({
                 firstName: ['', Validators.required],
                 lastName: ['', Validators.required]
             })
         })
     })
 }
Example #4
0
  constructor(private router: Router) {
    super();

    let fb = new FormBuilder();

    this.forgetForm = fb.group({
      email: ['']
    });

    this.error = '';
  }
 ngOnInit() {
   this.form = this.formBuilder.group({
     committeeYear: ['', Validators.required],
     newMember: this.formBuilder.group({
       name: ['', Validators.required]
     })
   });
   this.organogramId = this.routeSegment.getParam('organogramId');
   this.committeeYear = '';
   this.newMember = {name: ''};
 }
Example #6
0
  constructor(params: RouteParams) {
    var partyId = params.get('partyId');
    this.party = Parties.findOne(partyId);

    let fb = new FormBuilder();
    this.partyForm = fb.group({
     name: [''],
     description: [''],
     location: ['']
    });
  }
 constructor() {
   const fb = new FormBuilder();
   this.formModel = fb.group({
     'username': ['', Validators.required],
     'ssn': ['', ssnValidator],
     'passwordsGroup': fb.group({
       'password': ['', Validators.minLength(5)],
       'pconfirm': ['']
     }, {validator: equalValidator})
   });
 }
  constructor(private router: Router) {
    super();

    let fb = new FormBuilder();

    this.recoverForm = fb.group({
      email: ['', Validators.required]
    });

    this.error = '';
  }
Example #9
0
  constructor(private router: Router) {
   // super();

    let fb = new FormBuilder();

    this.signupForm = fb.group({
      email: ['', Validators.required],
      password: ['', Validators.required]
    });

    this.error = '';
  }
Example #10
0
  constructor(private router: Router) {
    super();

    let fb = new FormBuilder();

    this.loginForm = fb.group({
      username: [''],
      password: ['']
    });

    this.error = '';
  }
 constructor(
   private _userService: UserService,
   private _navController: Nav,
   private _formBuilder: FormBuilder) {
   this.passwordForm = this._formBuilder.group({
     'oldPassword': ['', Validators.required],
     matchingPassword: this._formBuilder.group({
       password: ['', Validators.compose([Validators.required, ValidationService.passwordValidator])],
       confirmPassword: ['', Validators.compose([Validators.required])]
     }, { validator: this.checkPasswords })
   });
 }
Example #12
0
    constructor(
        private authService: AuthentificationService,
        private router: Router
    ) {
        let fb = new FormBuilder();

        this.loginForm = fb.group({
            email: ['', Validators.required],
            password: ['', Validators.required]
        });
        this.users = Users.find();
    }
Example #13
0
 //metodo de validaciones 
  private _createMyForm(){
    return this.formBuilder.group({
      name: ['', Validators.required],
      lastName: ['', Validators.required],
      email:['', Validators.required],
      dateBirth:['', Validators.required],
      passwordRetry: this.formBuilder.group({
        password: ['', Validators.required],
        passwordConfirmation: ['', Validators.required]
      }),
      gender: ['', Validators.required],
    });
  }
Example #14
0
	constructor(private fb: FormBuilder, private userService: UserService, private router: Router) {

		// Create the username form control
		this.username = fb.control('', Validators.compose([Validators.required, Validators.minLength(3)]));
		this.username.valueChanges.subscribe((newValue) => { this.usernameErrorMessage = ''; });

		// Create the password form control
		this.password = fb.control('', Validators.compose([Validators.required]));
		this.password.valueChanges.subscribe((newValue) => { this.passwordErrorMessage = ''; });

		// Create the group
		this.userForm = fb.group({ username: this.username, password: this.password });
	}
 ngOnInit() {
     this.userForm = this.fb.group({
         'name': ['', Validators.required],
         'username': ['', Validators.required],
         'email': ['', Validators.compose([Validators.required, validEmail])],
         'phone': ['', onlyNumbers],
         'website': ['', validWebsite],
         'geo': this.fb.group({
             'lat': ['', validLocation],
             'lng': ['', validLocation]
         })
     });
 }
Example #16
0
  constructor(
      private u: UserService
  ) {
    //super();

    let fb = new FormBuilder();

    this.thisForm = fb.group({
      email: [''],
      password: ['']
    });

    this.error = '';
  }
Example #17
0
  constructor(public authData: AuthData, public formBuilder: FormBuilder, private nav: NavController) {
  	this.authData = authData;

  	this.resetPasswordForm = formBuilder.group( {
  		email: ['', Validators.required]
  	} )
  }
 public constructor(private _builder: FormBuilder) {
     super();
     this.gradeField = new Control('', StudentReviewPropertyGrade.validateGrade);
     this.form = this._builder.group({
         grade: this.gradeField
     });
 }
 createControl(): AbstractControl {
     let controlGroupConfig = this.templateOptions.options.reduce((previous, option) => {
         previous[option.key] = [this._model ? this._model[option.key] : undefined];
         return previous;
     }, {});
     return this.formBuilder.group(controlGroupConfig);
 }
    constructor(private apiDocService:ApiDocService,formBuilder: FormBuilder,private router:Router,private routeParams:RouteParams) {
        this.operation = new OperationObject();
        this.apiDetailForm = formBuilder.group({});
        this.apiDoc = new ApiDefinition();

        this.init();
    }
    constructor(fromBuilder: FormBuilder){

        this.loginForm = fromBuilder.group({
            email: ['', Validators.compose([Validators.required, CustomValidators.emailValidator])],
            password  : ['', Validators.required]
        });
    }
 ngOnInit() { 
     
     this.name = new Control('',
         Validators.compose([
             Validators.required
         ]));
         
      this.price = new Control('',
         Validators.compose([
             Validators.required
         ]));
         
      this.description = new Control('',
         Validators.compose([
             Validators.required,
             Validators.minLength(3),
             Validators.maxLength(50)
         ]));
         
      this.insertForm = this._fb.group({
          'name': this.name,
          'price': this.price,
          'description': this.description
      });
     
 }
Example #23
0
 constructor(builder: FormBuilder) {
   
   this.user = new User('joe.satriani@gmail.com', 'secretpass');
   
   this.email = new Control('', 
     Validators.compose([Validators.required, CustomValidators.emailFormat]),
     CustomValidators.duplicated
   );
   
   this.password = new Control('',
     Validators.compose([Validators.required, Validators.minLength(4)])
   );
   
   this.group = builder.group({
     email: this.email,
     password: this.password
   });
   
   this.email.valueChanges.subscribe((value: string) => {
     console.log('email', value);
   });
   this.password.valueChanges.subscribe((value: string) => {
     console.log('password', value);
   });
   this.group.valueChanges.subscribe((value: any) => {
     console.log('form', value);
   });
 }
Example #24
0
  toControlGroup(fields: FieldBase<any>[], model, key, value ): ControlGroup {
    let group = {};

    fields.forEach(field => {
      if (!field.template && !field.fieldGroup) {
          group[field.key] =  getControlGroup(this._fb, field);
      } else if (field.fieldGroup) {
          field.fieldGroup.forEach(f => {
              group[f.key] = getControlGroup(this._fb, f);
          });
      }
    });

    function getControlGroup(formBuilder, field) {
      let control;
      if (field.type === "radio") {
        let group = {};
        field.templateOptions.options.forEach(option => {
          group[option.key] = [new RadioButtonState(model[field.key] === option.value , option.key)];
        });
        control = formBuilder.group(group);
      } else {
        control = [(field.type === "checkbox") ? (model[field.key] ? "on" : undefined) : model[field.key] || "", field.key === key && value ? undefined : field.validation];
      }

      return control;
    }

    return this._fb.group(group);
  }
 constructor(private fb:FormBuilder,private router:Router,private loginService:LoginService) {
   this.loginForm = fb.group({
     email : ["",FormValidators.validateEmail],
     password:["",Validators.required]  
   }); 
   console.log('form ',this.loginForm)
 }
Example #26
0
 ngOnInit()
 {
   this.loginForm = this.fb.group({
     email: ["", Validators.required],
     password: ["", Validators.required]
   })
 }
Example #27
0
  constructor(public nav: NavController, public formBuilder: FormBuilder, public dataService: Data) {

    this.myDetailsForm = formBuilder.group({
      carRegistration: [''],
      trailerRegistration: [''],
      trailerDimensions: [''],
      phoneNumber: [''],
      notes: ['']
    });

    this.dataService.getMyDetails().then((details) => {

      let savedDetails: any = false;

      if(typeof(details) != "undefined"){
        savedDetails = JSON.parse(details);
      }

      let formControls: any = this.myDetailsForm.controls;

      if(savedDetails){
        formControls.carRegistration.updateValue(savedDetails.carRegistration);
        formControls.trailerRegistration.updateValue(savedDetails.trailerRegistration);
        formControls.trailerDimensions.updateValue(savedDetails.trailerDimensions);
        formControls.phoneNumber.updateValue(savedDetails.phoneNumber);
        formControls.notes.updateValue(savedDetails.notes);
      }

    });

  }
Example #28
0
  constructor(public nav: NavController, public formBuilder: FormBuilder, public dataService: Data) {

    this.campDetailsForm = formBuilder.group({
      gateAccessCode: [''],
      ammenitiesCode: [''],
      wifiPassword: [''],
      phoneNumber: [''],
      departure: [''],
      notes: ['']
    });

    this.dataService.getCampDetails().then((details) => {

      let savedDetails: any = false;

      if(typeof(details) != "undefined"){
        savedDetails = JSON.parse(details);
      }

      let formControls: any = this.campDetailsForm.controls;

      if(savedDetails){
        formControls.gateAccessCode.updateValue(savedDetails.gateAccessCode);
        formControls.ammenitiesCode.updateValue(savedDetails.ammenitiesCode);
        formControls.wifiPassword.updateValue(savedDetails.wifiPassword);
        formControls.phoneNumber.updateValue(savedDetails.phoneNumber);
        formControls.departure.updateValue(savedDetails.departure);
        formControls.notes.updateValue(savedDetails.notes);
      }

    });

  }
 public constructor(private _builder: FormBuilder) {
     super();
     this.text = new Control('', Validators.required);
     this.form = this._builder.group({
         text: this.text
     });
 }
Example #30
0
 ngOnInit() { 
     this.myForm = this.fb.group({
         'name': [''],
         'surname': [''],
         'email': ['']
     })
 }