Skip to content

Instantly share code, notes, and snippets.

@mohanramphp
Created June 17, 2018 07:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mohanramphp/2573952327161efc4336d0bc09cfecec to your computer and use it in GitHub Desktop.
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
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