Replacing ng-show with ng-if for showing alert msgs