change iterator method to angular.foreach
validation and messages of login inputs  added.