Skip to content

Commit

Permalink
feat(rating): remove glyphicons, add custom template support (#2631)
Browse files Browse the repository at this point in the history
BREAKING CHANGES:
- removed input properties stateOn, stateOff and ratingStates
- custom icons now working via customTemplate
  • Loading branch information
IlyaSurmay authored and valorkin committed Sep 14, 2017
1 parent 4e40497 commit ea39858
Show file tree
Hide file tree
Showing 5 changed files with 106 additions and 399 deletions.
12 changes: 9 additions & 3 deletions demo/src/app/components/+rating/demos/custom/custom.html
Original file line number Diff line number Diff line change
@@ -1,9 +1,15 @@
<div>
<rating [(ngModel)]="x" max="15" stateOn="glyphicon-ok-sign" stateOff="glyphicon-ok-circle"
style="color: #0275d8;"></rating>
<rating max="10" [(ngModel)]="x" [customTemplate]="t" style="color: #0275d8;font-size: 20px;"></rating>
<b>(<i>Rate:</i> {{x}})</b>
<ng-template #t let-index="index" let-value="value">{{index < value ? '&#9745;' : '&#9744;'}}</ng-template>
</div>

<div>
<rating [(ngModel)]="y" [ratingStates]="ratingStates"></rating>
<rating max="10" [(ngModel)]="y" [customTemplate]="tt"></rating>
<b>(<i>Rate:</i> {{y}})</b>
<ng-template #tt let-i="index" let-v="value">
<button class="btn btn-{{i < v ? 'warning' : 'default'}}">
{{i < v ? '&#9733;' : '&#9734;'}}
</button>
</ng-template>
</div>
Loading

0 comments on commit ea39858

Please sign in to comment.