码迷,mamicode.com
首页 > Web开发 > 详细

[AngularJS] Use ng-model-options to limit $digest

时间:2015-11-15 00:47:34      阅读:236      评论:0      收藏:0      [点我收藏+]

标签:

Refer: http://toddmotto.com/super-fast-angular-ng-model-options-limit-digest-cycles/

 

Use:

<input 
  type="text" 
  ng-model="test"
  ng-model-options="{
    ‘updateOn‘: ‘default blur‘,
    ‘debounce‘: {
      ‘default‘: 250,
      ‘blur‘: 0
    }
  }">

 

With Angular Formly:

Refer: http://angular-formly.com/#/example/field-options/model-options

 

Use:

{
        key: ‘text‘,
        type: ‘input‘,
        modelOptions: {
          debounce: {
            default: 2000,
            blur: 0
          },
          updateOn: ‘default blur‘
        },
        templateOptions: {
          label: ‘Debounce‘,
          placeholder: ‘update on blur and default‘
        }
      },

 

[AngularJS] Use ng-model-options to limit $digest

标签:

原文地址:http://www.cnblogs.com/Answer1215/p/4965890.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!