Skip to content

Instantly share code, notes, and snippets.

@SirajGadhia
Last active February 6, 2016 04:20
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 SirajGadhia/25830b119270298db83b to your computer and use it in GitHub Desktop.
Save SirajGadhia/25830b119270298db83b to your computer and use it in GitHub Desktop.
//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