File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -32,15 +32,20 @@ IonicModule
32
32
transclude : true ,
33
33
template : '<label class="item item-radio">' +
34
34
'<input type="radio" name="radio-group"' +
35
- ' ng-model="ngModel" ng-value="ngValue " ng-change="ngChange()">' +
35
+ ' ng-model="ngModel" ng-value="getValue() " ng-change="ngChange()">' +
36
36
'<div class="item-content disable-pointer-events" ng-transclude></div>' +
37
37
'<i class="radio-icon disable-pointer-events icon ion-checkmark"></i>' +
38
38
'</label>' ,
39
39
40
40
compile : function ( element , attr ) {
41
41
if ( attr . name ) element . children ( ) . eq ( 0 ) . attr ( 'name' , attr . name ) ;
42
42
if ( attr . icon ) element . children ( ) . eq ( 2 ) . removeClass ( 'ion-checkmark' ) . addClass ( attr . icon ) ;
43
- if ( attr . value ) element . children ( ) . eq ( 0 ) . attr ( 'value' , attr . value ) ;
43
+
44
+ return function ( scope , element , attr ) {
45
+ scope . getValue = function ( ) {
46
+ return scope . ngValue || attr . value ;
47
+ } ;
48
+ } ;
44
49
}
45
50
} ;
46
51
} ) ;
You can’t perform that action at this time.
0 commit comments