I have set ng-class on the div i want to apply css when file is selected so below onSelect i want to change div color to green. How can i achieve this task using AngularJs ?
html
<div class="text-arrow" ng-class="{activeBackground:applyActive}">File Selection<span class="arrow-div"></span></div>
css
.activeBackground{
background-color: green;
}
script.js
$scope.onSelect = function (e) {
$scope.applyActive = true;
}
ng-class="{activeBackground:applyActive}"it should beng-class="{'activeBackground':applyActive}"'single qoute will be used only when class name will have special character..it will work without'too