From 369175700e11f31a59a234fcbfc4b1df3d91aaa5 Mon Sep 17 00:00:00 2001 From: Sarun Intaralawan Date: Thu, 6 Oct 2016 16:24:27 +0700 Subject: [PATCH] fix(build): All `@HostBinding` and `@HostListener` should be public (#1086) fixes #1080 --- components/buttons/readme.md | 8 ++++---- components/modal/modal.component.ts | 4 ++-- components/progressbar/readme.md | 2 +- components/typeahead/typeahead.directive.ts | 8 ++++---- 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/components/buttons/readme.md b/components/buttons/readme.md index 04d9e0e1da..605e774675 100644 --- a/components/buttons/readme.md +++ b/components/buttons/readme.md @@ -13,10 +13,10 @@ export class ButtonRadioDirective implements ControlValueAccessor, OnInit { @Input() public uncheckable:boolean; @HostBinding('class.active') - private get isActive() {} + public get isActive() {} @HostListener('click') - private onClick() {} + public onClick() {} } // directive ButtonCheckbox @Directive({ selector: '[btnCheckbox][ngModel]' }) @@ -25,10 +25,10 @@ export class ButtonCheckboxDirective implements ControlValueAccessor, OnInit { @Input() public btnCheckboxFalse:any; @HostBinding('class.active') - private state:boolean = false; + public state:boolean = false; @HostListener('click') - private onClick() {} + public onClick() {} } ``` diff --git a/components/modal/modal.component.ts b/components/modal/modal.component.ts index 3b2820f56b..2e612726ea 100644 --- a/components/modal/modal.component.ts +++ b/components/modal/modal.component.ts @@ -73,7 +73,7 @@ export class ModalDirective implements AfterViewInit, OnDestroy { // @HostBinding(`class.${ClassName.IN}`) private _addClassIn:boolean; @HostListener('click', ['$event']) - protected onClick(event: any): void { + public onClick(event: any): void { if (this.config.ignoreBackdropClick || this.config.backdrop === 'static' || event.target !== this.element.nativeElement) { return; } @@ -83,7 +83,7 @@ export class ModalDirective implements AfterViewInit, OnDestroy { // todo: consider preventing default and stopping propagation @HostListener('keydown.esc') - protected onEsc(): void { + public onEsc(): void { if (this.config.keyboard) { this.hide(); } diff --git a/components/progressbar/readme.md b/components/progressbar/readme.md index 915b5c7569..95f5e8e189 100644 --- a/components/progressbar/readme.md +++ b/components/progressbar/readme.md @@ -15,7 +15,7 @@ export class ProgressDirective implements OnInit { @HostBinding('attr.max') @Input() public get max():number {} - @HostBinding('class') private addClass = 'progress'; + @HostBinding('class') public addClass = 'progress'; } // class Bar implements OnInit, OnDestroy diff --git a/components/typeahead/typeahead.directive.ts b/components/typeahead/typeahead.directive.ts index fb5e726424..527936eedf 100644 --- a/components/typeahead/typeahead.directive.ts +++ b/components/typeahead/typeahead.directive.ts @@ -68,7 +68,7 @@ export class TypeaheadDirective implements OnInit { private componentsHelper:ComponentsHelper; @HostListener('keyup', ['$event']) - protected onChange(e:any):void { + public onChange(e:any):void { if (this.container) { // esc if (e.keyCode === 27) { @@ -109,7 +109,7 @@ export class TypeaheadDirective implements OnInit { } @HostListener('focus', ['$event.target']) - protected onFocus():void { + public onFocus():void { if (this.typeaheadMinLength === 0) { this.typeaheadLoading.emit(true); this.keyUpEventEmitter.emit(''); @@ -117,14 +117,14 @@ export class TypeaheadDirective implements OnInit { } @HostListener('blur') - protected onBlur():void { + public onBlur():void { if (this.container && !this.container.isFocused) { this.hide(); } } @HostListener('keydown', ['$event']) - protected onKeydown(e:KeyboardEvent):void { + public onKeydown(e:KeyboardEvent):void { // no container - no problems if (!this.container) { return;