UNPKG

landers.angular

Version:

landers.angular

23 lines (22 loc) 981 B
;angular.module('Landers.angular') .directive('inputBool', ['Flat', function(Flat){ return { restrict : 'AE', // scope: {ngModel: '='}, template : function($ele, attrs){ var name = attrs['name']; return [ // '<span>=={{ngModel}}</span>', '<label class="i-checks btn"', ' ng-repeat="item in [{text: \'是\', value:1}, {text: \'否\', value:0}]">', // ' <input type="radio" name="inputBool" ng-model="ngModel"', ' <input type="radio" name="'+ name +'" ng-model="' + attrs['ngModel'] + '"', ' value="{{item.value}}" class="form-control"/>', ' <i></i><span>{{item.text}}</span>', '</label>', ].join(' '); }, link : function($scope, $ele, $attrs){ } } }]);