I am using PrimeNg Calendar in my angular 7 project, wanted to disable month navigator on some conditions at the component level. Ex: Current Month is February, I want to disable month navigator after the march month.
Using :host and ::ng-deep I can override Primeng styles in CSS file
:host ::ng-deep .ui-datepicker .ui-datepicker-header .ui-datepicker-next{
display:none;
}
But I want to do the changing styles in the component. Tried below code, but not working
let datePickerNext = document.querySelectorAll('.ui-datepicker .ui-datepicker-header .ui-datepicker-prev');
datePickerNext.forEach(element => {
element.setAttribute("style", " margin-top: 0.6em;opacity: 0.2;");
});
Any ideas to achieve this