AngularJS 教程
在失去焦點(diǎn)時綁定輸入框的值到 scope 變量中:
ng-model-options 指令綁定了 HTML 表單元素到 scope 變量中
你可以指定綁定數(shù)據(jù)觸發(fā)的時間,或者指定等待多少毫秒,參數(shù)設(shè)置可以參考以下說明。
<input>, <select>, <textarea>, 元素支持該指令。
值 | 描述 |
---|---|
option | 指定了綁定數(shù)據(jù)的規(guī)則,規(guī)則如下: {updateOn: 'event'}規(guī)則指定事件發(fā)生后綁定數(shù)據(jù) {debounce : 1000} 規(guī)定等待多少毫秒后綁定數(shù)據(jù) {allowInvalid : true|false} 規(guī)定是否需要驗(yàn)證后綁定數(shù)據(jù) {getterSetter : true|false} 規(guī)定是否作為 getters/setters 綁定到模型 {timezone : '0100'} 規(guī)則是否使用時區(qū) |