Skip to content

Instantly share code, notes, and snippets.

View rebelholic's full-sized avatar

WannabeCoder rebelholic

View GitHub Profile
@rebelholic
rebelholic / RandomBackgroundcolor.js
Created July 20, 2016 09:52 — forked from samuelbeek/RandomBackgroundcolor.js
Random Background Color Directive for Angularjs
// 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);