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.
Success – the current state of validations are shown.
Next let’s try to click the stock name input field.
Once the selected field lost the focus, blur event is triggered. Therefore, it has been touched.
Next let’s try to input a value. Since a value was already provided, it should be changed to ng-dirty