-
-
Notifications
You must be signed in to change notification settings - Fork 497
"rz-slider-tpl-url" Not working? #354
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
It should work and there is already a demo for it: http://angular-slider.github.io/angularjs-slider/ - "Slider with custom template to use HTML formatting for ticks" |
I followed the demo, but it didn't work. Is there anything else I need to keep an eye on? Maybe by understanding the src code can help me with using this attribute. Could you please provide some explaination of the src code piece? |
There you go: https://github.com/angular-slider/angularjs-slider/blob/master/src/rzslider.js#L2049 If you still cannot fix your issue, please provide a JSFiddle showing what you are trying to do, and I'll help you. ;) |
Thanks Valentin. What's the difference between src/rzslider.js and ` $templateCache.put('rzSliderTpl.html', <span class="rz-bar rz-selection" ng-style=barStyle> <span class="rz-pointer rz-pointer-min" ng-style=minPointerStyle> <span class="rz-pointer rz-pointer-max" ng-style=maxPointerStyle> <span class="rz-bubble rz-limit rz-floor"> <span class="rz-bubble rz-limit rz-ceil"> "
); ` |
The dist file just contains the inline default template. |
I put the custom template file on the same level as the html file that uses th rzslider directive (for example, index.html), it's working. Now, I have another question: How do I pass the variables being defined in my own controller (for example, index.js) to the custom template file? |
I don't think it's possible because there are 2 different scopes. |
Well, it could be a nice feature for the next release ;) |
How would you implement such a feature? I don't see how this is possible because this is due to the isolation of scopes in Angular... |
One way I can think of is to add a customizable option for user, for example, an option with a key named "myOption", user can pass in an object that contains any thing the user wants as a value, then user can use that object in custom templte. |
OK, I see now. I can add this feature as a |
Do you have an example of use case for this feature? |
Great. I don't have live code for you at the moment. I'll explain here: Under a partial directory, I have four files:
I wish to have "customScope" variable being defined in myController.js, for example: Please let me know if you need more details. Thanks! |
But why does it have to be displayed in the slider template? Cant you just display it outside of it in its own template/directive? |
That's by design. Need to have it on template. A customscope would be very |
The time value is displayed on the slider? |
Yep. It's not just the time value, could be something else too. Just need |
I'm sorry to insist but I have seen so many users that needed a feature for the slider while they could have done it themselves, outside of the library. I don't want the library to implement all the custom features of every users so I want to make sure of that. Could you please provide a mock-up of what you want to achieve? |
I understand that. But I don't think I can implement this myself, I will |
👍 |
OK I see, but don't you think that the tooltip should be handled in the chart part? |
Well. I wish. But that's by design, so I don't have a choice, I have to |
I mean, the tooltip should be handled by the chart, this is not the slider concern |
The expected result is to have the tooltip move with the green slider (When On Wed, Jul 6, 2016 at 1:29 PM, Valentin Hervieu notifications@github.com
|
Added this option in 5.2.0: |
Great! Thank you very much! Can't wait to use this feature ;) On Wed, Jul 6, 2016 at 11:17 PM, Valentin Hervieu notifications@github.com
|
I tried to use "rz-slider-tpl-url" attribute to customize my slider, but can't get it work. I looked at the source js file, looks like it's always pointing to the provided template. If this feature is working properly, could anyone please provide a demo example?
I am using the js/css file from dist directory.
Thank you!
The text was updated successfully, but these errors were encountered: