Skip to content

Commit

Permalink
feat(dropdown): added exportAs to dropdown directives (#785)
Browse files Browse the repository at this point in the history
* Added exportAs to dropdown directives

* Added 'bs-*' prefix

* updated dropdown docs

* prefix typo fix
  • Loading branch information
tiagoroldao authored and valorkin committed Aug 5, 2016
1 parent f146a22 commit 66531c7
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 5 deletions.
5 changes: 4 additions & 1 deletion components/dropdown/dropdown-menu.directive.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
import {Directive, ElementRef, Host, OnInit, HostBinding} from '@angular/core';
import {DropdownDirective} from './dropdown.directive';

@Directive({selector: '[dropdownMenu]'})
@Directive({
selector: '[dropdownMenu]',
exportAs: 'bs-dropdown-menu'
})
export class DropdownMenuDirective implements OnInit {
public dropdown:DropdownDirective;
public el:ElementRef;
Expand Down
5 changes: 4 additions & 1 deletion components/dropdown/dropdown-toggle.directive.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,10 @@ import {global} from '@angular/core/src/facade/lang';
const MouseEvent = (global as any).MouseEvent as MouseEvent;
/* tslint:enable */

@Directive({selector: '[dropdownToggle]'})
@Directive({
selector: '[dropdownToggle]',
exportAs: 'bs-dropdown-toggle'
})
export class DropdownToggleDirective implements OnInit {
@HostBinding('class.disabled')
@Input() public isDisabled:boolean = false;
Expand Down
5 changes: 4 additions & 1 deletion components/dropdown/dropdown.directive.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,10 @@ import {
} from '@angular/core';
import {dropdownService, NONINPUT} from './dropdown.service';

@Directive({selector: '[dropdown]'})
@Directive({
selector: '[dropdown]',
exportAs: 'bs-dropdown'
})
export class DropdownDirective implements OnInit, OnDestroy {
@HostBinding('class.open')
@Input()
Expand Down
10 changes: 8 additions & 2 deletions components/dropdown/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,10 @@ import { DROPDOWN_DIRECTIVES } from 'ng2-bootstrap/components/dropdown';
### Annotations
```typescript
// directive Dropdown
@Directive({ selector: '[dropdown]' })
@Directive({
selector: '[dropdown]',
exportAs: 'bs-dropdown'
})
export class Dropdown implements OnInit, OnDestroy {
@HostBinding('class.open')
@Input() public get isOpen():boolean {}
Expand All @@ -32,7 +35,10 @@ export class Dropdown implements OnInit, OnDestroy {
}

// directive DropdownToggle
@Directive({ selector: '[dropdownToggle]' })
@Directive({
selector: '[dropdownToggle]',
exportAs: 'bs-dropdown-toggle'
})
export class DropdownToggle implements OnInit {
@HostBinding('class.disabled')
@Input() public isDisabled:boolean = false;
Expand Down

0 comments on commit 66531c7

Please sign in to comment.