This seems like it should be simple to me but I'm struggling! I'm working on my second grails app, the first used angular.js but I can't this time around due to legacy browser requirements. I have built some of my page templates using the .gsp template hooks (g:each, g:if etc) and some JQuery to do some basic presentational stuff. The problem now is that I need to use the data that the .gsp is accessing (basic http get request along with the page load) within my JavaScript.
I could just make the controller render the data as JSON but then the grails template hooks would stop working.
I could fetch all the values from the DOM and build a local model in JS OR I could do some horrible mix-up of outputting data using .gsp g:each and then saving each one to JS inline but both processes seem ridiculous.
I could get the controller to respond with data for the .gsp AND render as JSON separately for the JS but this just seems wrong!
I'm at a loss as to how to do this, please offer any suggestions!
data-attributes? - charlietfl