JSFiddle - React, Tailwind, and code Playground
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>
<script src="http://vitalets.github.io/angular-xeditable/dist/js/xeditable.js"></script>
<link rel="stylesheet" href="https://netdna.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<link rel="stylesheet" href="http://vitalets.github.io/angular-xeditable/dist/css/xeditable.css">
<div ng-app="app" ng-controller="Ctrl">
<div ng-repeat="s in legendItems">
<div class="epLegendeColorBoxPopover" ng-style='{"background-color": s.color}'></div><input type="text" ng-model="s.description">
</div>
</div>
CSS
div[ng-app] {
margin: 50px;
}
.epLegendeColorBoxPopover {
width: 30px;
border: 1px solid #7b7b7b;
height: 20px;
font-size: 10px;
float: left;
}
TypeScript
var app = angular.module("app", ["xeditable"]);
app.run(function(editableOptions) {
editableOptions.theme = 'bs3';
});
app.controller('Ctrl', function($scope) {
var _legendItems = localStorage.getItem("legendItems");
if(_legendItems){
$scope.legendItems = JSON.parse(_legendItems)
}else{
$scope.legendItems = [
{color: 'rgb(234, 219, 37)', description: '1', isEnabled: true},
{color: "rgb(236, 185, 218)", description: "2", isEnabled: true},
{color: "rgb(217, 220, 210)", description: "3", isEnabled: true},
{color: "rgb(126, 222, 96)", description: "4", isEnabled: true},
{color: "rgb(88, 196, 228)", description: "5", isEnabled: true},
{color: "rgb(255, 170, 14)", description: "6", isEnabled: true},
{color: "rgb(249, 167, 135)", description: "7", isEnabled: true},
{color: "rgb(245, 73, 73)", description: "8", isEnabled: true},
{color: "rgb(191, 168, 129)", description: "9", isEnabled: true}
]
}
$scope.$watch("legendItems",function(legendItems){
localStorage.setItem(
"legendItems",
angular.toJson(legendItems)
)
},true)
});