docs: function() {
    return {
      require: 'ngModel',
      link: function(scope, element, attr, ctrl) {
        var match = /\/(.*)\//.exec(attr.ngList),
            separator = match && new RegExp(match[1]) || attr.ngList || ',';
  
        var parse = function(viewValue) {
          // If the viewValue is invalid (say required but empty) it will be `undefined`
          if (isUndefined(viewValue)) return;
  
          var list = [];
  
          if (viewValue) {
            forEach(viewValue.split(separator), function(value) {
              if (value) list.push(trim(value));
            });
          }
  
          return list;
        };
  
        ctrl.$parsers.push(parse);
        ctrl.$formatters.push(function(value) {
          if (isArray(value)) {
            return value.join(', ');
          }
  
          return undefined;
        });
  
        // Override the standard $isEmpty because an empty array means the input is empty.
        ctrl.$isEmpty = function(value) {
          return !value || !value.length;
        };
      }
    };
  }