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?

2
  • Are other tooltips working on the page? I can only guess you don't have the proper js/css included on the page. Commented Jan 23, 2015 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. Commented Jan 23, 2015 at 18:20

1 Answer 1

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";
            }
  };
Sign up to request clarification or add additional context in comments.

1 Comment

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.