Wijmo 5 - InputColor and ColorPicker
HTML
<link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css">
<script src="http://cdn.wijmo.com/5.latest/controls/wijmo.min.js"></script>
<link rel="stylesheet" href="http://cdn.wijmo.com/5.latest/styles/wijmo.min.css">
<script src="http://cdn.wijmo.com/5.latest/controls/wijmo.input.min.js"></script>
<script src="http://cdn.wijmo.com/5.latest/interop/angular/wijmo.angular.min.js"></script>
<!-- mark this as an Angular application and give it a controller -->
<div ng-app="app" ng-controller="appCtrl">
<h3>
InputColor and ColorPicker controls</h3>
<p>
Use the InputColor control to edit color values
when you have only a little room:</p>
<wj-input-color ng-model="theColor" lost-focus="colorLostFocus(s, e)" is-required="false" value-changed="colorChanged(s, e)"></wj-input-color>
<p/>
<p>
Use the ColorPicker control to edit color values
when you have enough room:</p>
<!--<wj-color-picker value="theColor"></wj-color-picker>-->
<p/>
<p>
Here's a div showing the color you selected:</p>
<div style="height:60px;background-color:{{theColor}}">
</div>
Color: <input ng-model="theColor">
<h1>
You entered: {{theColor}}
</h1>
</div>
JavaScript
// define app, include Wijmo 5 directives
var app = angular.module('app', ['wj']);
// controller
app.controller('appCtrl', function ($scope) {
$scope.theColor = 'gold';
$scope.colorLostFocus = function(s, e) {
console.log('-----------------');
console.log("s.value: " + s.value);
console.log("scopeCol: " + $scope.theColor);
/*s.value = "";
$scope.theColor = "";*/
s.isDroppedDown = true;
s.isDroppedDown = false;
console.log('-----------------');
console.log("s.value: " + s.value);
console.log("scopeCol: " + $scope.theColor);
}
});