/
githubmirror
/
ionic-framework
Обзор
Документация
Войти
/
githubmirror
/
ionic-framework
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
packages/angular/src/directives/control-value-accessors/select-value-accessor.ts
27 строк
843 B
Amanda Johnston
fix(angular,vue): range form value updates while dragging knob (#28422)
30 окт 2023, 18:18
Не верифицирован
30 окт 2023, 18:18
0854a11
Код
Авторство
О чём код?
import { ElementRef, Injector, Directive, HostListener } from '@angular/core'; import { NG_VALUE_ACCESSOR } from '@angular/forms'; import { ValueAccessor } from '@ionic/angular/common'; @Directive({ /* tslint:disable-next-line:directive-selector */ selector: 'ion-select, ion-radio-group, ion-segment, ion-datetime', providers: [ { provide: NG_VALUE_ACCESSOR, useExisting: SelectValueAccessorDirective, multi: true, }, ], }) export class SelectValueAccessorDirective extends ValueAccessor { constructor(injector: Injector, el: ElementRef) { super(injector, el); } @HostListener('ionChange', ['$event.target']) _handleChangeEvent( el: HTMLIonSelectElement | HTMLIonRadioGroupElement | HTMLIonSegmentElement | HTMLIonDatetimeElement ): void { this.handleValueChange(el, el.value); } }