Files
ROLAC/APP/src/components/drop-down-list/drop-down-list.service.ts
T
Chris Chen d5648315a0 WIP
2026-05-25 17:32:18 -07:00

25 lines
668 B
TypeScript

import { Injectable } from '@angular/core';
import { Observable, Subject } from 'rxjs';
import { DropDownOption } from '../../entity/dropDownOption';
import { DropDownBag } from './drop-down-menu/drop-down-menu.component';
@Injectable({
providedIn: 'root'
})
export class DropDownListService {
constructor() { }
onItemSelect = new Subject<DropDownBag>();
focusIndexChange = new Subject<DropDownBag>();
selectItem(tag: string, item: DropDownOption) {
this.onItemSelect.next({ tag: tag, item: item } as DropDownBag)
}
setFocusIndex(tag: string, i: number) {
this.focusIndexChange.next(
{ tag: tag, focusIndex: i } as DropDownBag);
}
}