My application generates data in a table, where each cell has a unique combination of background color and text color determined by its properties.
The code to achieve this is simple:
ng-style='{"background-color": lt.backgroundColor, "color": lt.textColor}'>
Now, I need to create a print view that only includes certain elements, but the challenge is preserving the colors – which are crucial. Typically, adding !important
to the CSS rule would ensure they are printed.
This time, however, I am using ng-style to manage the colors. How can I incorporate !important
within ng-style?
I attempted
lt.backgroundColor+""+"!important"
without success,
Even trying
ng-style='{"background-color": "#000 !important"....}
only works if I remove the !important like:
ng-style='{"background-color": "#000"....}
By keeping only the hexadecimal code, it displays correctly in the print view.
Any solutions to this problem?