简体   繁体   中英

angularjs-color-picker no color in picker

I am trying to use angularjs-color-picker however the color picker doesnt show up with any color.

方格区域应充满颜色

I have added "angularjs-color-picker": "3.4.8" to package.json

I added angularjs-color-picker.min.css, angularjs-color-picker-bootstrap.min.css, tinycolor-min.js, & angularjs-color-picker.min.js to gulpfile.js

I included the module with angular.module('app', ['color.picker']);

And this is what is looks like in the html: <color-picker ng-model="myColor"></color-picker>

Really stuck on why no colour is showing up. If I missed a directive I apologize, any input is appreciated.

Angular: 1.6 & Bootstrap: 3

You need to include tinycolor.js

Here is the codepen link, where colors are availble in picker.

https://codepen.io/swatifursule/pen/WJrmbB

html file :

<script src="https://cdnjs.cloudflare.com/ajax/libs/angular.js/1.6.10/angular.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/tinycolor/1.4.1/tinycolor.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/angularjs-color-picker/3.4.8/angularjs-color-picker.js"></script>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/angularjs-color-picker/3.4.8/angularjs-color-picker.css">
<html ng-app="app">
<head></head>
<body>
  <color-picker ng-model="myColor"></color-picker>
</body>
</html>

Js file:

angular.module('app', ['color.picker']);

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM