This is the archived documentation for Angular v5. Please visit angular.io to see documentation for the current version of Angular.

NgSelectOption

npm Package @angular/forms
Module import { NgSelectOption } from '@angular/forms';
Source forms/src/directives/select_control_value_accessor.ts

Marks <option> as dynamic, so Angular can be notified when options change.

Overview

      
      @Directive({ selector: 'option' })
class NgSelectOption implements OnDestroy {
  id: string
  set ngValue: any
  set value: any
  ngOnDestroy(): void
}
    

How To Use

See docs for SelectControlValueAccessor for usage examples.

Selectors

      
      option
    

Inputs

ngValue bound to NgSelectOption.ngValue
value bound to NgSelectOption.value

Constructor

      
      constructor(_element: ElementRef, _renderer: Renderer2, _select: SelectControlValueAccessor)
    

Members

      
      id: string
    

      
      set ngValue: any
    

      
      set value: any
    

      
      ngOnDestroy(): void