-
Notifications
You must be signed in to change notification settings - Fork 10
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
change template to be dynamic #3
Comments
Hi Matthew, Like:
|
I've played around with this concept earlier, but it was angular 1.3 if I remember correctly and had a few issues with the $scope not applying to the template.. What I really want to do is have the whole template generated by angular, via ng-repeat, and layers controlled via scope. |
Yes, that's true. I suppose, that the idea is to $compile each layer inside the directive .... |
Hi Mathew, I modified your directive a little bit to meet our basic requirements of using variables inside the template being loaded. Hope this help you with your incoming work of making them dynamic... ;)
Best, |
Hey @Karnith or @jiferrero, did either of you make progress on this? I can't seem to follow the changes that @jiferrero made, but I desperately want to use revolution slider with angular.. Im guessing this is not possible at this time |
Hi @rossvz ... what do you need to do? We implemented the solution, although it is adapted to what we needed, as described above. You can see working in angular 1.4.x in this link that we are using to test some different elements https://kernstein.org |
@jiferrero essentially I have async data from an API to display product images or videos. I have a service that gets the data, and tried to do do an ng-repeat based on that data for each div, but that seems to fail. It looks like the jQuery plugin needs all the data loaded when it loads? I tried looking into the angular directive but im not sure how to modify it to use my data? |
Hi... That's what we are actually doing... And that's why we change the directive to compile the templates and can access its scope to make the interpolation. I'm currently on trip an have no access to my computer, but tomorrow night I will have. So if you want I can send you the directive so you can play with. If you need any help with it, I will be so glad in helping you. ---- Ross van Zyl escribió ----
|
@jiferrero that would be great! Perhaps this would be a good PR for this project? |
Pretty sure of that... 😉 ---- Ross van Zyl escribió ----
|
Hi rossvz.... What we did with the directive is changing it as follow, so you can load the template and compile it to add the variables you may need in the scope allowing them to be interpolated. I let you the commented code so you can see what it what changed. You can use it in the same way, but know your template can have any {{expresion}} tha you can interpolate from your controller once the service has load it from the API... Essentially is what we do in the web I gave you the link. The photos, videos or text in the slide template are injected from a REST service and then compile it and shown. /** ** Version: 1.0.0 - 2015-12-07
angular.module("rev.slider.tpls", ["template/slider/slider.tpl.html"]);
' \n' + ...... [the rest of the template code, although really we don't need it]....... |
Hello , I'm sorry for asking repetitive question, I have an object which contain only images so how can i integrate that object with this Plugin |
Template is currently static. Template needs to be revised so that it can be built by angular object with ng-repeat, etc..
The text was updated successfully, but these errors were encountered: