How can I dynamically change the color of a CSS class after using ng-class and add a property to an existing CSS class?
<style>
customcss:after{
border-top: 7px solid green;
}
</style>
I want to be able to change the color dynamically using either ng-class or ng-style.
I have tried the following:
<html>
<div ng-class="{customcss: true}" ng-style="topcolor('yellow')"></div>
</html>
<script>
$scope.topcolor = function (color) {
return '7px solid ' + color;
}
</script>
enter code here
Despite the above attempt, the color is not changing dynamically. Can someone please help me solve this issue?