@@ -43,7 +43,7 @@ function (_, $, coreModule) {
43
43
var selected = _ . find ( $scope . altSegments , { value : value } ) ;
44
44
if ( selected ) {
45
45
segment . value = selected . value ;
46
- segment . html = selected . html ;
46
+ segment . html = selected . html || selected . value ;
47
47
segment . fake = false ;
48
48
segment . expandable = selected . expandable ;
49
49
}
@@ -186,27 +186,26 @@ function (_, $, coreModule) {
186
186
187
187
$scope . getOptionsInternal = function ( ) {
188
188
if ( $scope . options ) {
189
- cachedOptions = _ . map ( $scope . options , function ( option ) {
190
- return uiSegmentSrv . newSegment ( { value : option . text } ) ;
191
- } ) ;
192
- return $q . when ( cachedOptions ) ;
189
+ cachedOptions = $scope . options ;
190
+ return $q . when ( _ . map ( $scope . options , function ( option ) {
191
+ return { value : option . text } ;
192
+ } ) ) ;
193
193
} else {
194
194
return $scope . getOptions ( ) . then ( function ( options ) {
195
- cachedOptions = _ . map ( options , function ( option ) {
195
+ cachedOptions = options ;
196
+ return _ . map ( options , function ( option ) {
196
197
if ( option . html ) {
197
198
return option ;
198
199
}
199
- return uiSegmentSrv . newSegment ( { value : option . text } ) ;
200
+ return { value : option . text } ;
200
201
} ) ;
201
- return cachedOptions ;
202
202
} ) ;
203
203
}
204
204
} ;
205
205
206
206
$scope . onSegmentChange = function ( ) {
207
-
208
207
if ( cachedOptions ) {
209
- var option = _ . find ( cachedOptions , { value : $scope . segment . value } ) ;
208
+ var option = _ . find ( cachedOptions , { text : $scope . segment . value } ) ;
210
209
if ( option && option . value !== $scope . property ) {
211
210
$scope . property = option . value ;
212
211
} else if ( attrs . custom !== 'false' ) {
0 commit comments