How to use onBlur event on Angular2?

前端 未结 7 1263
时光取名叫无心
时光取名叫无心 2020-12-02 21:36

How do you detect an onBlur event in Angular2? I want to use it with


Can anyone help me understand how to use i

7条回答
  •  鱼传尺愫
    2020-12-02 22:28

    This is the proposed answer on the Github repo:

    // example without validators
    const c = new FormControl('', { updateOn: 'blur' });
    
    // example with validators
    const c= new FormControl('', {
       validators: Validators.required,
       updateOn: 'blur'
    });
    

    Github : feat(forms): add updateOn blur option to FormControls

提交回复
热议问题