title: How to display error message when passwords doesn't match in Angularjs?
body: <p>I'm new at Angularjs and my question is how to display an error message when the password doesn't match with confirm password?
  Can someone help me, this is not very difficult but I'm still learning to programme. 
  Thanks to everyone!
  I have html code:</p>
  
  <pre><code>&lt;form ng-submit="saveItem(userForm.$valid)" name="userForm"&gt;
      &lt;div class="row"&gt;
          &lt;div class="col-sm-6"&gt;
              &lt;div class="form-group"&gt;
                  &lt;label for="database_address"&gt;User&lt;/label&gt;
                  &lt;input type="text" class="form-control" required ng-model="activeItem.username" placeholder="Потребителско Име..." /&gt;
              &lt;/div&gt;
  
              &lt;div class="form-group"&gt;
                  &lt;label for="password"&gt;Password&lt;/label&gt;
                  &lt;input type="text" class="form-control" id="password" ng-model="activeItem.passwordString"  /&gt;
              &lt;/div&gt;
              &lt;div class="form-group"&gt;
                  &lt;label for="password"&gt;Confirm Password&lt;/label&gt;
                  &lt;input type="text" class="form-control" id="password" ng-model="activeItem.passwordConfirm"  /&gt;
              &lt;/div&gt;
                &lt;p ng-show="(userForm.passwordConfirm != '') &amp;&amp; (userForm.password != userForm.passwordConfirm)"&gt;Passwords don't match&lt;/p&gt;
  
          &lt;/div&gt;
          &lt;div class="col-sm-6"&gt;
              &lt;div class="form-group"&gt;
                  &lt;label for="username"&gt;Operator&lt;/label&gt;
                  &lt;input type="text" class="form-control" required id="username" ng-model="activeItem.name" /&gt;
              &lt;/div&gt;
          &lt;/div&gt;
      &lt;/div&gt;
      &lt;button class="btn btn-primary" ng-disabled="userForm.$invalid" type="submit"&gt;Save&lt;/button&gt;
      &lt;!--&lt;button class="btn btn-primary" ng-disabled="userForm.$invalid" type="submit"&gt;Добавяне на нов&lt;/button&gt;--&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>And angular function:</p>
  
  <pre><code>$scope.saveItem = function(){
          console.log($scope.activeItem);
          //delete $scope.activeItem.hash_method
          var objectToSave = {
              username: $scope.activeItem.username,
              //password: $scope.activeItem.password,
              name: $scope.activeItem.name,
              id: $scope.activeItem.id
          };
  
          if($scope.activeItem.passwordString != ''){
              if($scope.activeItem.passwordString == $scope.activeItem.passwordConfirm){
                  objectToSave.password = $scope.activeItem.passwordString;
              } else {
                      console.log('Confirm password error');
  
              }
          }
  </code></pre>