This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// just add random-backgroundcolor to the element you want to give a random background color | |
app.directive("randomBackgroundcolor", function () { | |
return { | |
restrict: 'EA', | |
replace: false, | |
link: function (scope, element, attr) { | |
//generate random color | |
var color = '#' + (Math.random() * 0xFFFFFF << 0).toString(16); | |