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