From 8795f2a9b250ace652886a074d5bc588787f9287 Mon Sep 17 00:00:00 2001 From: GP Date: Thu, 14 Jul 2016 09:39:01 +0200 Subject: [PATCH] Add the dropdown-menu class to dropdown menus (#541) --- components/dropdown/dropdown-menu.directive.ts | 8 +++++++- components/dropdown/readme.md | 2 +- demo/components/dropdown/dropdown-demo.html | 2 +- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/components/dropdown/dropdown-menu.directive.ts b/components/dropdown/dropdown-menu.directive.ts index a68ec296f6..a6e3960a16 100644 --- a/components/dropdown/dropdown-menu.directive.ts +++ b/components/dropdown/dropdown-menu.directive.ts @@ -1,10 +1,16 @@ -import {Directive, ElementRef, Host, OnInit} from '@angular/core'; +import {Directive, ElementRef, Host, OnInit, HostBinding} from '@angular/core'; import {DropdownDirective} from './dropdown.directive'; @Directive({selector: '[dropdownMenu]'}) export class DropdownMenuDirective implements OnInit { public dropdown:DropdownDirective; public el:ElementRef; + + /* tslint:disable:no-unused-variable */ + @HostBinding('class.dropdown-menu') + public addClass:boolean = true; + /* tslint:enable:no-unused-variable */ + public constructor(@Host() dropdown:DropdownDirective, el:ElementRef) { this.dropdown = dropdown; this.el = el; diff --git a/components/dropdown/readme.md b/components/dropdown/readme.md index 8e7e97c3ae..269d571b46 100644 --- a/components/dropdown/readme.md +++ b/components/dropdown/readme.md @@ -8,7 +8,7 @@ import { DROPDOWN_DIRECTIVES } from 'ng2-bootstrap/components/dropdown'; ```html
- +
diff --git a/demo/components/dropdown/dropdown-demo.html b/demo/components/dropdown/dropdown-demo.html index 624e4b3cee..aff3c3e700 100644 --- a/demo/components/dropdown/dropdown-demo.html +++ b/demo/components/dropdown/dropdown-demo.html @@ -16,7 +16,7 @@ -