2014-12-04 54 views

回答

18

望着source of the ngModelOptions directive,看来,而不是设置updateOn : 'default',你需要设置controller.$options.updateOnDefault = true;

+1

再次你需要看源代码,哦谢谢你们!很棒的API文档 – 2016-01-19 13:23:41

15

对于你的情况,你可以尝试

ngModelController.$options = { 
    updateOn: 'blur', 
    updateOnDefault: true, 
    debounce: { 
     'blur': 2000, 
     'default': 3000 
    } 
    }; 

但现在(NG1。 6+)你必须这样做(更多here,herehere):

ngModelController.$overrideModelOptions({ 
    updateOn: 'blur', 
    updateOn: 'default', 
    debounce:= { 
     'blur': 2000, 
     'default': 3000 
    } 
}); 
+0

谢谢救了我的一天! – 2015-09-17 06:41:45

+0

@steampowered你是完全正确的,我会更新 – 2017-09-04 13:34:57

相关问题