- Notifications
You must be signed in to change notification settings - Fork 155
Dynamic title/content #24
Conversation
| @marudor hi, first of all thanks for your time and for the PR, help is always appreciated! I didn't had any chance to try your changes yet, but having a quick look it seems to me that is no more possible to use html inside both tooltip-title and tooltip-content attributes... Am i mistaking? |
| You are correct. Let me change it. I've used ng-bind. Just changing it to ng-bind-html should do the trick. |
| Works for HTML as well now. |
| @marudor Hi man, sorry for the delay, actually you did an awesome job but, really, ngSanitize is not needed, the aim is to release an indipendent so 0 dependencies module. Thanks for your time |
| Well in that case you could assume valid HTML and mark it safe with $sce. |
| @marudor the $sce (if working) could be the solution, let know if you try something 👯 We would just avoid including exetrnal file for the directive like ngSanitize |
| @marudor This is exactly the issue I have been struggling with and I happened to stumble upon the PR. I would be glad to help, if you need it. Thanks for putting up the fix. |
| There you go. |
| @marudor While testing I found that just plain static text in the
while dynamic content works fine.
Can you verify that? |
| @rupakg You have to wrap it as string. |
| @marudor cool. interesting comment about the |
| @marudor How about when using markup and binding? This used to work before changes: I am using ngSantize. I tried with the single quotes as you suggested above and I've also tried with ng-bind on spans instead of expression. Thanks for any help! |
| For that I will probably need to adjust it a little. |
| @marudor thank you for the time you are spending on this! 👍 |
| @marudor Sounds great. What about templates with Angular template or templateURL? Maybe that would be a better way to deal with it? I'm a bit of an Angular n00b, though. |
| sounds a little over kill for using an Angular template for a tooltip! |
| Yeah, I guess so. Just seems a bit clunky to me to have to declare the markup for tooltip-content over and over again for each tooltip if you don't want to use the default structure. Either way, the $compile(tooltipContent)($scope) fix @marudor is making would help a ton. |
| Hi @marudor, I've reviewed the diffs in this PR. It's seems legit to me to merge the actual commits, we need only one last thing: could you please update the README.md integrating the you intervents? Thanks a lot for your commitment and contribution! Dario |
| @marudor @bubbleheadinc @marudor Sorry, i don't quite understand the discussion topic at the moment, but (just guessing), is having the possibility to inject html templates inside tooltip-content="" and tooltip-title="" what you are discussing for? Because, in such case, cound't be better a new attribute, for example tooltip-template="" ? |
| @45kb Yes, I was suggesting a template instead of -content so as to more easily manage any custom structure. Unfortunately I don't have the knowledge to code it, but it seems to me another attribute would work well if anyone was willing to put it together. |
| @rupakg we would @marudor to finish pushing changes, he just need to pull all the new changes from the master , verify and commit. Actually, if in a hurry, you can use his changes from here https://github.com/marudor/angular-tooltips Let's give him some time he is doing it for all and for free 👍 |
| @rupakg no problems at all 👍 as soon as this feature is ready we will make a new updated release don't worry |
| Hi all, we just merged a new PR for dynamic content and title feel free to try it #37 Now the only thing missing is ngSanitize on them... I am going to remove this PR but, seriously, feel free to open another one if necessary! Thanks a lot to everyone. |
Using two way binding to watch for changes to title or content.
Also re-inits the tooltip to fix positioning.
Fixes #23
Requires Angular 1.3 > due to $watchGroups.
Also removes the feature to just use the title attribute.
Only works with tooltip-title and tooltip-content