Created
June 17, 2018 07:08
-
-
Save mohanramphp/2573952327161efc4336d0bc09cfecec to your computer and use it in GitHub Desktop.
To show the configuration need to pass for lib-ratify component in the template
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { Component } from '@angular/core'; | |
@Component({ | |
selector: 'app-root', | |
templateUrl: './app.component.html', | |
styleUrls: ['./app.component.css'] | |
}) | |
export class AppComponent { | |
grade = 0; // current rating - default to pass to the component | |
maxRating = 5; // max rating - can be 5 or 10. Based on user convinence | |
showRatingCounter = true; // to show the rating state to the user like 2 out of 5 | |
myRating: number; // To get the selected rating from the component once user selects | |
selectedRating(rate: number) { | |
console.log('your rating is'); | |
console.log(rate); | |
this.myRating = rate; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment