-
-
Notifications
You must be signed in to change notification settings - Fork 497
Not possible to have html ticks values when showTicksValues is true #277
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Hmmm having a dependency on ngSanitize is not really good to me since I don't want to add a requirement that will be useless for 99% of the slider users. Actually, when implementing #251, I didn't think about this issue but the string passed to html() should also be sanitized to avoid exploits. I need to think more about it... |
I agree that sanitizing is generally a good idea. For my case, there actually is an easy fix. I copied the default template, did my fix mentioned above, and used rz-slider-tpl-url to use my custom template. Not optimal, but definitely working. |
well, you could use $sce.trustAsHtml(html) and ng-bind-html in the template? so no need to use ngSanitize, right? or use a filter like |
Indeed, but in order to use $sce, |
Not being able to use html ticks is a real buzzkill for me |
I understand but I couldn't find a solution so far. If you have something to suggest, I would be grateful! ;) |
I used @saus's suggestion for now. I override the template and use ng-bind-html with ngSantize to get the desired result. |
Yes this is a good workaround, I should probably document the template overriding so other users can use it. |
Yeah, I had to go in the source to find that option. Documenting would be a good idea, maybe even add a example with ng-bind-html |
well seems like the only option, if you dont want any dependencies. but to be honest, using ng-bind-html and custom template will do. However, as @boboldehampsink stated, a small hint in the documentation, would be good. |
Documentation added about |
Demo added in http://angular-slider.github.io/angularjs-slider. Check the "Slider with custom template to use HTML formatting for ticks" part. ;) |
Steps to reproduce
Could be fixed by using ng-bind-html in rzSliderTpl.html, but that will probably add dependency on ngSanitize (?)
Demo: http://jsfiddle.net/9xdgjjb7/1/
Expected behaviour
Show ticks values without html escaped
Actual behaviour
Html tags are escaped
The text was updated successfully, but these errors were encountered: