JSFiddle - React, Tailwind, and code Playground
by ckosloski
HTML
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.6.4/angular.min.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.6.4/angular-sanitize.min.js"></script>
<link rel="stylesheet" href="https://netdna.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<script src="https://vitalets.github.io/angular-xeditable/dist/js/xeditable.js"></script>
<link rel="stylesheet" href="https://vitalets.github.io/angular-xeditable/dist/css/xeditable.css">
<h4>Angular-xeditable Radiolist (Bootstrap 3)</h4>
<div ng-app="app" ng-controller="RadiolistCtrl">
<p> Radiolist:
<a href="#" editable-radiolist="user.status" e-ng-options="s.value as s.text for s in ::statuses track by s.value">
{{ showStatus() }}
</a>
</p>
<p> Select:
<a href="#" editable-select="user.status" e-ng-options="s.value as s.text for s in ::statuses">
{{ showStatus() }}
</a>
</p>
</div>
CSS
div[ng-app] { margin: 50px; }
.editable-radiolist label {
display: block;
}
JavaScript
var app = angular.module("app", ["xeditable"]);
app.run(function(editableOptions) {
editableOptions.theme = 'bs3';
});
app.controller('RadiolistCtrl', function($scope, $filter) {
$scope.user = {
status: 'a'
};
$scope.statuses = [
{value: 'a', text: 'status1'},
{value: 'b', text: 'status2'}
];
$scope.showStatus = function() {
var selected = $filter('filter')($scope.statuses, {value: $scope.user.status});
return ($scope.user.status && selected.length) ? selected[0].text : 'Not set';
};
});