Skip to content

Commit

Permalink
fix(dropdown): explicitly markForCheck() (#566)
Browse files Browse the repository at this point in the history
  • Loading branch information
andreialecu authored and valorkin committed Jun 6, 2016
1 parent 686a96e commit 0ce4328
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions components/dropdown/dropdown.directive.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import {
Directive, OnInit, OnDestroy, Input, Output, HostBinding, EventEmitter,
ElementRef
ElementRef, ChangeDetectorRef
} from '@angular/core';
import {dropdownService, NONINPUT} from './dropdown.service';

Expand Down Expand Up @@ -30,10 +30,13 @@ export class DropdownDirective implements OnInit, OnDestroy {
public el:ElementRef;
private _isOpen:boolean;

public constructor(el:ElementRef) {
private _changeDetector: ChangeDetectorRef;

public constructor(el:ElementRef, ref:ChangeDetectorRef) {
// @Query('dropdownMenu', {descendants: false})
// dropdownMenuList:QueryList<ElementRef>) {
this.el = el;
this._changeDetector = ref;
// todo: bind to route change event
}

Expand All @@ -56,6 +59,7 @@ export class DropdownDirective implements OnInit, OnDestroy {
}
this.onToggle.emit(this.isOpen);
this.isOpenChange.emit(this.isOpen);
this._changeDetector.markForCheck();
// todo: implement call to setIsOpen if set and function
}

Expand Down

0 comments on commit 0ce4328

Please sign in to comment.