2014-12-04 58 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

相關問題