All Downloads are FREE. Search and download functionalities are using the official Maven repository.

app.directives.ngModelOnBlur.js Maven / Gradle / Ivy

The newest version!
define(['angular'],
function (angular) {
  'use strict';

  angular
    .module('kibana.directives')
    .directive('ngModelOnblur', function() {
      return {
        restrict: 'A',
        require: 'ngModel',
        link: function(scope, elm, attr, ngModelCtrl) {
          if (attr.type === 'radio' || attr.type === 'checkbox') {
            return;
          }

          elm.unbind('input').unbind('keydown').unbind('change');
          elm.bind('blur', function() {
            scope.$apply(function() {
              ngModelCtrl.$setViewValue(elm.val());
            });
          });
        }
      };
    });
});




© 2015 - 2025 Weber Informatics LLC | Privacy Policy