@@ -106,6 +106,13 @@ export class RangeKnob {
106
106
* the slider knob. It can accept dual knobs, but by default one knob
107
107
* controls the value of the range.
108
108
*
109
+ * ### Range Labels
110
+ * Labels can be placed on either side of the range by adding the
111
+ * `range-left` or `range-right` property to the element. The element
112
+ * doesn't have to be an `ion-label`, it can be added to any element
113
+ * to place it to the left or right of the range. See [usage](#usage)
114
+ * below for examples.
115
+ *
109
116
*
110
117
* ### Minimum and Maximum Values
111
118
* Minimum and maximum values can be passed to the range through the `min`
@@ -135,15 +142,18 @@ export class RangeKnob {
135
142
* </ion-item>
136
143
*
137
144
* <ion-item>
138
- * <ion-note item-left>-200</ion-note>
139
- * <ion-range min="-200" max="200" pin="true" [(ngModel)]="saturation" secondary></ion-range>
140
- * <ion-note item-right>200</ion-note>
145
+ * <ion-range min="-200" max="200" [(ngModel)]="saturation" secondary>
146
+ * <ion-label range-left>-200</ion-label>
147
+ * <ion-label range-right>200</ion-label>
148
+ * </ion-range>
141
149
* </ion-item>
142
150
*
143
- * <ion-item>
144
- * <ion-label>step=2, {{singleValue3}}</ion-label>
145
- * <ion-range min="20" max="80" step="2" [(ngModel)]="singleValue3"></ion-range>
146
- * </ion-item>
151
+ * <ion-item>
152
+ * <ion-range min="20" max="80" step="2" [(ngModel)]="brightness">
153
+ * <ion-icon small range-left name="sunny"></ion-icon>
154
+ * <ion-icon range-right name="sunny"></ion-icon>
155
+ * </ion-range>
156
+ * </ion-item>
147
157
*
148
158
* <ion-item>
149
159
* <ion-label>step=100, snaps, {{singleValue4}}</ion-label>
@@ -163,13 +173,15 @@ export class RangeKnob {
163
173
@Component ( {
164
174
selector : 'ion-range' ,
165
175
template :
176
+ '<ng-content select="[range-left]"></ng-content>' +
166
177
'<div class="range-slider" #slider>' +
167
178
'<div class="range-tick" *ngFor="let t of _ticks" [style.left]="t.left" [class.range-tick-active]="t.active"></div>' +
168
179
'<div class="range-bar"></div>' +
169
180
'<div class="range-bar range-bar-active" [style.left]="_barL" [style.right]="_barR" #bar></div>' +
170
181
'<div class="range-knob-handle"></div>' +
171
182
'<div class="range-knob-handle" [upper]="true" *ngIf="_dual"></div>' +
172
- '</div>' ,
183
+ '</div>' +
184
+ '<ng-content select="[range-right]"></ng-content>' ,
173
185
host : {
174
186
'[class.range-disabled]' : '_disabled' ,
175
187
'[class.range-pressed]' : '_pressed' ,
0 commit comments