You are here

function theme_ng_select in AngularJS 7

Returns HTML for a ng-select form element.

1 theme call to theme_ng_select()
angularjs_element_info in ./angularjs.module
Implements hook_element_info().

File

./angularjs.module, line 401

Code

function theme_ng_select($variables) {
  $element = $variables['element'];
  element_set_attributes($element, array(
    'id',
    'name',
    'size',
  ));
  _form_set_class($element, array(
    'form-select',
  ));
  return '<select' . drupal_attributes($element['#attributes']) . ' ng-model="' . $element['#ng_model'] . '.selected" ng-options="option.value as option.name for option in ' . $element['#ng_model'] . '.options"></select> ';
}