PrimeNg custom validation using CSS


I am using validationFlag in my TS code. Based on this I want to validate and focus PrimeNG elements (p-dropdown, p-autocomplete). I have tried below approach seems not working. However if I try similar on HTML elements then it works. Has anyone faced similar issues?
None of below working –

<p-dropdown placeholder="1" [ngStyle]=" {‘border-color’:’red’}" >

<p-dropdown placeholder="2" [style]="{‘border-color’:’red’}" >

<p-dropdown placeholder="3" name = "val" id = "val" [style] =" mandatoryFlag==’set’ ? {‘border-color’:’red’} : {‘border-color’:’blue’} " >

<p-dropdown placeholder="4" name = "val" id = "val" [ngStyle] =" mandatoryFlag==’set’ ? {‘border-color’:’red’} : {‘border-color’:’blue’} " >

Source: Angular Questions

Categorized as angular, css, primeng, primeng-dropdowns Tagged , , ,


Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Still Have Questions?

Our dedicated development team is here for you!

We can help you find answers to your question for as low as 5$.

Contact Us