Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
//http://www.siraj360.com/ng2/ :: A single page application developed with Angular 2 (beta) and Bootstrap 4 (alpha).
import { Component } from 'angular2/core';
import { RouterLink } from 'angular2/router';
import { RatingComponent } from '../rating/rating.component';
@Component({
selector: 'home',
templateUrl: 'app/components/home/home.component.html',
directives: [RouterLink, RatingComponent]
})
export class HomeComponent {
private rate: number;
rating: number
per_rating: string;
constructor() {
this.rate = 3;
this.rating = 3;
this.per_rating = "60%";
}
onRatingChange(value: number) {
// debugger;
this.rating = value;
this.per_rating = '' + (value * 20) + '%';
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment