I am being try to get the color of an element using angular js, but am unsuccessful. Here is what I am doing:
function colorApply() {
var cardsList = document.getElementsByClassName("card-abbr");
$timeout(function() {
angular.forEach(cardsList, function(value) {
var color = value.css('color');
/*var color = value.style.color;*/
console.log(color);
});
}, 1000);
}
My CSS:
.card-abbr:nth-child(1n) {
color: #EF2525;
}
.card-abbr:nth-child(2n) {
color: #88ba41;
}
.card-abbr:nth-child(3n) {
color: #850057;
}
.card-abbr:nth-child(4n) {
color: #003f60;
}
.card-abbr:nth-child(5n) {
color: #588ba3;
}
This is returning nothing for me. Please help.
htmlstructure as well?