clean rating component (#1854)

This commit is contained in:
Eugenio Romano 2017-05-03 17:33:10 +02:00 committed by Eugenio Romano
parent 934509c7ba
commit 4188a5aee9
2 changed files with 8 additions and 1 deletions

View File

@ -65,7 +65,7 @@ describe('Like component', () => {
jasmine.Ajax.uninstall();
});
it('should like component should be present', (done) => {
it('should like component be present', (done) => {
fixture.detectChanges();
component.ngOnChanges().subscribe(() => {

View File

@ -42,6 +42,8 @@ export class LikeComponent {
}
ngOnChanges() {
this.clean();
let ratingObserver = this.ratingService.getRating(this.nodeId, this.ratingType);
ratingObserver.subscribe(
@ -77,4 +79,9 @@ export class LikeComponent {
this.changeVote.emit(this.likesCounter);
}
clean() {
this.isLike = false;
this.likesCounter = 0;
}
}