From 66531c7cda6c8e4b73cc3aedc4875d872e96e57a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tiago=20Rold=C3=A3o?= Date: Fri, 5 Aug 2016 13:47:53 +0100 Subject: [PATCH] feat(dropdown): added exportAs to dropdown directives (#785) * Added exportAs to dropdown directives * Added 'bs-*' prefix * updated dropdown docs * prefix typo fix --- components/dropdown/dropdown-menu.directive.ts | 5 ++++- components/dropdown/dropdown-toggle.directive.ts | 5 ++++- components/dropdown/dropdown.directive.ts | 5 ++++- components/dropdown/readme.md | 10 ++++++++-- 4 files changed, 20 insertions(+), 5 deletions(-) diff --git a/components/dropdown/dropdown-menu.directive.ts b/components/dropdown/dropdown-menu.directive.ts index a6e3960a16..390a31e612 100644 --- a/components/dropdown/dropdown-menu.directive.ts +++ b/components/dropdown/dropdown-menu.directive.ts @@ -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; diff --git a/components/dropdown/dropdown-toggle.directive.ts b/components/dropdown/dropdown-toggle.directive.ts index b996013af8..b36b8f2438 100644 --- a/components/dropdown/dropdown-toggle.directive.ts +++ b/components/dropdown/dropdown-toggle.directive.ts @@ -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; diff --git a/components/dropdown/dropdown.directive.ts b/components/dropdown/dropdown.directive.ts index d7a98a7765..1461b44558 100644 --- a/components/dropdown/dropdown.directive.ts +++ b/components/dropdown/dropdown.directive.ts @@ -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() diff --git a/components/dropdown/readme.md b/components/dropdown/readme.md index c9b7bfe5ea..83941f7b32 100644 --- a/components/dropdown/readme.md +++ b/components/dropdown/readme.md @@ -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 {} @@ -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;