2

I am trying to integrate angular-tooltips with input form. I want to change tooltip text on registrationForm.email.$error object change.

HTML:

<input tooltips tooltip-html="{{ emailToolTip }}" tooltip-show-trigger="focus" tooltip-hide-trigger="blur" tooltip-side="right"/>
<div>{{emailToolTip}}</div>

Controller:

$scope.emailToolTip = 'Initial tooltip';
$scope.$watch('registrationForm.email.$error', function (newVal) {
  $scope.emailToolTip = 'Updated tooltip';
}}, true);

above code changes <div> value but it doesn't change <input>'s 'tooltip-html' attribute value. Am I missing anything or is it a bug?

I am using this angular-tooltips library https://github.com/720kb/angular-tooltips

1
  • do you have any idea how we can use tooltip-show-trigger with custom events or something similar. I want to show tooltip at page load but onload, load, onready etc are not working. Any idea, how we can do it? Commented Jul 6, 2018 at 7:50

2 Answers 2

1

you should use

tooltip-title="{{ emailToolTip }}"

instead of

tooltip-html="{{ emailToolTip }}"

Sign up to request clarification or add additional context in comments.

3 Comments

Great! it works, but I was wondering why html doesn't work. I want to add some html content in it.
If it solved your problem you can accept this solution. thanks
Its added as a feature in this library now github.com/720kb/angular-tooltips/issues/78
0

Looking at your link I'd guess you should look to : "Tooltip view controller" in order to have a dynamic content

Comments

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.