feature(ngbTypeahead): add exportAs property on the directive decorator

Trying to get reference to ngbTypeahead

<input [editable]="false" type="text" [(ngModel)]="model" [ngbTypeahead]="search" [resultFormatter]="formatter" #ta=ngbTypeahead/>

to check if the popup is open {{ta.isPopupOpen()}}

please add exportAs: ‘ngbTypeahead’ property on the directive decorator to enable that functionality
https://github.com/ng-bootstrap/ng-bootstrap/blob/master/src/typeahead/typeahead.ts

@Directive({
  selector: 'input[ngbTypeahead]',
  exportAs: 'ngbTypeahead',
  host: {
    '(blur)': 'handleBlur()',
    '[class.open]': 'isPopupOpen()',
    '(document:click)': 'dismissPopup()',
    '(keydown)': 'handleKeyDown($event)',
    'autocomplete': 'off',
    'autocapitalize': 'off',
    'autocorrect': 'off',
    'role': 'combobox',
    'aria-multiline': 'false',
    '[attr.aria-autocomplete]': 'showHint ? "both" : "list"',
    '[attr.aria-activedescendant]': 'activeDescendant',
    '[attr.aria-owns]': 'isPopupOpen() ? popupId : null',
    '[attr.aria-expanded]': 'isPopupOpen()'
  },
  providers: [NGB_TYPEAHEAD_VALUE_ACCESSOR]
})
......

Angular:
4.0.3
ng-bootstrap:
4.0.0-alpha.6

1 possible answer(s) on “feature(ngbTypeahead): add exportAs property on the directive decorator