Form validation and related flags will only be set if you have ng-model controllers assigned to the appropriate controls. Therefore, assign them the ng-model directive. Instead of using id you can use name . It will then be used as an alias (property names) for the corresponding ng model controller assigned to the formController instance (ex: loginForm.username.$valid ).
<div class="form-group"> <label for="email">Username:</label> <input type="email" class="form-control" ng-model="ctrl.userName" name="username" placeholder="Enter username" required> </div> <div class="form-group"> <label for="pwd">Password:</label> <input type="password" class="form-control" ng-model="ctrl.password" name="pwd" placeholder="Enter password" required> </div>
source share