Skip to content

Commit

Permalink
Fixed #4994
Browse files Browse the repository at this point in the history
  • Loading branch information
Çağatay Çivici authored and Çağatay Çivici committed Jan 31, 2018
1 parent b25915c commit 9eff45c
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/app/components/rating/rating.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {NgModule,Component,ElementRef,OnInit,Input,Output,EventEmitter,forwardRef} from '@angular/core';
import {NgModule,Component,ElementRef,OnInit,Input,Output,EventEmitter,forwardRef,ChangeDetectorRef} from '@angular/core';
import {CommonModule} from '@angular/common';
import {NG_VALUE_ACCESSOR, ControlValueAccessor} from '@angular/forms';

Expand Down Expand Up @@ -50,6 +50,8 @@ export class Rating implements ControlValueAccessor {
@Output() onRate: EventEmitter<any> = new EventEmitter();

@Output() onCancel: EventEmitter<any> = new EventEmitter();

constructor(private cd: ChangeDetectorRef) {}

value: number;

Expand Down Expand Up @@ -91,6 +93,7 @@ export class Rating implements ControlValueAccessor {

writeValue(value: any) : void {
this.value = value;
this.cd.detectChanges();
}

registerOnChange(fn: Function): void {
Expand Down

0 comments on commit 9eff45c

Please sign in to comment.