Skip to content

Commit ea39858

Browse files
IlyaSurmayvalorkin
authored andcommitted
feat(rating): remove glyphicons, add custom template support (valor-software#2631)
BREAKING CHANGES: - removed input properties stateOn, stateOff and ratingStates - custom icons now working via customTemplate
1 parent 4e40497 commit ea39858

File tree

5 files changed

+106
-399
lines changed

5 files changed

+106
-399
lines changed
Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,15 @@
11
<div>
2-
<rating [(ngModel)]="x" max="15" stateOn="glyphicon-ok-sign" stateOff="glyphicon-ok-circle"
3-
style="color: #0275d8;"></rating>
2+
<rating max="10" [(ngModel)]="x" [customTemplate]="t" style="color: #0275d8;font-size: 20px;"></rating>
43
<b>(<i>Rate:</i> {{x}})</b>
4+
<ng-template #t let-index="index" let-value="value">{{index < value ? '&#9745;' : '&#9744;'}}</ng-template>
55
</div>
6+
67
<div>
7-
<rating [(ngModel)]="y" [ratingStates]="ratingStates"></rating>
8+
<rating max="10" [(ngModel)]="y" [customTemplate]="tt"></rating>
89
<b>(<i>Rate:</i> {{y}})</b>
10+
<ng-template #tt let-i="index" let-v="value">
11+
<button class="btn btn-{{i < v ? 'warning' : 'default'}}">
12+
{{i < v ? '&#9733;' : '&#9734;'}}
13+
</button>
14+
</ng-template>
915
</div>

0 commit comments

Comments
 (0)