Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
marukx opened this issue May 19, 2017 · 2 comments
Closed

Comments

@marukx
Copy link

marukx commented May 19, 2017

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

@marukx marukx changed the title feature(typeahead): add exportAs property on the directive decorator feature(ngbTypeahead): add exportAs property on the directive decorator May 19, 2017
@wesleycho
Copy link
Member

This sounds like a reasonable request - feel free to file a PR adding it.

@Serginho
Copy link

Serginho commented Nov 3, 2017

Re open the issue, cause exportAs has been removed.

maxokorokov pushed a commit to changLiuUNSW/ng-bootstrap that referenced this issue Nov 21, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants