I need help updating ng-class to apply a CSS class with a unique background image. Here is an example of what I am trying to achieve:
<button id="search" ng-class="{travel: travel }">Search</button>
for(var i = 0; i < arrayLength; i++) {
var descriptions = uniqueFilters[i].split(' ');
if(descriptions.indexOf('Travel') > -1) {
$scope.travel = "travel";
} else {
}
}}
When I receive an array of strings, I split the sentences into individual words. If a specific word is found, I update the class to add a background image. How can I make this work effectively?