The CreatorCon Call for Content is officially open! Get started here.

How to use ng-required atribute in service portal?

rshegde
Mega Contributor

Hi,

I want to highlight a mandatory field when the button is clicked. I know ng-required directive is there, but do not know how to use it. can someone explain how to use it?

Regards,

Rajeev

1 REPLY 1

Gaurav Bajaj
Mega Sage

Hi Rajiv,



You need to use this attribute within <form> tag.


Also, you can use the classes defined by angular to showcase valid, invalid, dirty, pristine, required to highlight your field.


Below link will help you out in understanding the whole process.


https://scotch.io/tutorials/angularjs-form-validation