0

This is the generated DOM:

<input class="form-control col-md-11 input ng-scope ng-animate ng-dirty ng-valid-required ng-invalid ng-invalid-minlength" type="password" value="" placeholder="*******" ng-model="user.confirmpassword" required="required" maxlength="80" autocomplete="off" ng-minlength="6" tooltip="Passwords do no match" tooltip-trigger="true" tooltip-placement="right" style="-webkit-transition-timing-function: initial, initial; transition-timing-function: initial, initial; -webkit-transition-delay: initial, initial; transition-delay: initial, initial;">

enter image description here

In the HTML:

<div class="col-md-9 text-left"><input class="form-control col-md-11 input" type="password" Value="" placeholder="*******" ng-model="user.confirmpassword" required="required" maxlength="80" autocomplete="off" ng-minlength="6" tooltip="Passwords do no match" tooltip-trigger="{{user.password !== user.confirmpassword}}" tooltip-placement="right"></div>

The tooltip-trigger is true but still no sign of tooltip. Anything, I am doing wrong?

Rachel Gallen
  • 27,943
  • 21
  • 72
  • 81
batmaniac7
  • 422
  • 5
  • 17
  • Are other tooltips working on the page? I can only guess you don't have the proper js/css included on the page. – Scott Jan 23 '15 at 18:14
  • @Scott short answer yes. I have one another but that is not with an expression. it is a direct one. with no expression. – batmaniac7 Jan 23 '15 at 18:20

1 Answers1

0

I believe tooltip-trigger was not meant to be a true/false but rather an event. A quick test with true/false doesn't seem to work. A much simpler solution would be something like this.

  <input ng-model="password" tooltip="{{theTooltip()}}">
  <input ng-model="matchPassword" tooltip="{{theTooltip()}}">

  $scope.password;
  $scope.matchPassword;
  $scope.theTooltip = function() {
            if($scope.password == $scope.matchPassword) {
                return "matching";
            } else {
                return "not matching";
            }
  };
Scott
  • 1,690
  • 3
  • 13
  • 18
  • Yes. you are right. it is not made to work with true/false. The problem i was having was that the tooltip only works on `focus`, `blur`, `mouseenter`, `mouseleave` and only then the tooltip is displayed and not just on expression. So, it works in few cases and not other times. Thanks for the input though. – batmaniac7 Jan 26 '15 at 22:48