Skip to content

Commit

Permalink
fix(checkbox): fix value output (#1505)
Browse files Browse the repository at this point in the history
  • Loading branch information
nnixaa authored May 27, 2019
1 parent 7e14ef5 commit 0ea3167
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/framework/theme/components/checkbox/checkbox.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ export class NbCheckboxComponent implements ControlValueAccessor {
}
set value(value: boolean) {
this._value = value;
this.change.emit(value);
this.valueChange.emit(value);
this.onChange(value);
}
private _value: boolean = false;
Expand Down Expand Up @@ -197,7 +197,7 @@ export class NbCheckboxComponent implements ControlValueAccessor {
}
private _indeterminate: boolean = false;

@Output() change = new EventEmitter();
@Output() valueChange = new EventEmitter();

@HostBinding('class.status-primary')
get primary() {
Expand Down
2 changes: 1 addition & 1 deletion src/framework/theme/components/checkbox/checkbox.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ describe('Component: NbCheckbox', () => {
});

it('should emit change event when changed', fakeAsync(() => {
checkbox.change
checkbox.valueChange
.pipe(take(1))
.subscribe((value: boolean) => expect(value).toEqual(true));

Expand Down

0 comments on commit 0ea3167

Please sign in to comment.