Y
Y
Yuri Zubik2016-07-26 16:24:06
Angular
Yuri Zubik, 2016-07-26 16:24:06

How to apply styles to angular objects?

app.directive("changeColors", function () {
return function (scope, element, attributes) {
// element -jqlite object
var elements = element.find("td"); //get all child elements
console.log( elements);
for(var i = 0; i < elements.length; i++) {
// if element contains red text, make it red
if (elements.eq(i).text() == "Online") {
elements .eq(i).css("color", "green")
}
}
}
})
This is js . and this is html
{{service.name}}
{{service.status}}
How do I apply a background color to the one generated by angular.
In a regular table, the jqlita code works.
Online - maybe because of this class.
Help plzz

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question