c.addGreenBackground = function() { $timeout( function() { //timeout needed because we have to wait for the MRVS to be populated with the new values $scope.page.g_form.getDisplayValue('u_applicable_services').split(',').filter(function (el) {return el != null;}).forEach(function(el){ if (el && $("td:contains('" + el.trim() + "')").length>0) $("td:contains('" + el.trim() + "')").parent().css("background-color", "#98fb98"); }) }, 500); }