code: function calculateInputValueLength(value) {
        value = ngTrim && !isPasswordInput && angular.isString(value) ? value.trim() : value;
        if (value === undefined || value === null) {
          value = '';
        }
        return String(value).length;
      }
docs: Calculate the input value's length after coercing it to a string
  and trimming it if appropriate.
  @param value {*} the input's value
  @returns {number} calculated length of the input's value