AngularJS directive to non interactive html components

Standard

Using utilities to get work done is always comfortable and good practice for sake of code re usability. Recently I came across a requirement where I had to make my several HTML component non clickable.

You can make input types elements non clickable very easily as disabled attribute works well with input types. But wait! what about other elements? Now a days we have lots of third party UI frameworks as angular-material or bootstrap which provides custom stitched input type like md-checkbox in angular material library.

Continue reading

ng-message validation based on other input field in angularJs

Standard

Recently I faced an requirement where I have to plugin ng-message validation which depends on value of other input field means if value of field A is given then only field B is mandatory. For example, if user is providing phone no then email is not mandatory else email is mandatory.

Yes we can achieve this in a very simple and straight forward way. Lets see how.

Goal: Using ng-messages validation depending upon the value of other field

Continue reading