In this section, we will further discuss Angular CSS demo classes through the following exercises.

Here, Instead of writing ng-valid, ng-pristine, etc. one by one, we can call it all by using className. It will fetch the validity of a given variable, in this case, #stockName and #stockCode.

IT Certification Category (English)728x90

angular css demo

angular css demo

Success – the current state of validations are shown.

Next let’s try to click the stock name input field.

angular css demo

Once the selected field lost the focus, blur event is triggered. Therefore, it has been touched.

angular css demo

Next let’s try to input a value. Since a value was already provided, it should be changed to ng-dirty

angular css demo

All done!