首页 > 解决方案 > 如何禁用“ngx-intl-tel-input”库中的标志?

问题描述

如何禁用“ngx-intl-tel-input”库中的标志,我禁用表单中的输入字段有 ngx-intl-tel-input 但没有禁用标志。请参阅已修复的问题“ https://github.com/webcat12345/ngx-intl-tel-input/issues/205

标签: angular7flags

解决方案


此问题已在最新版本中修复。要禁用您的控制,包括国家下拉菜单:

phoneForm = new FormGroup({
   phone: new FormControl({
    value: undefined,
    disabled: true
  }, [Validators.required])
});

或者

this.phoneForm.controls['phone'].disable();

推荐阅读