Is there a way to selectively load certain JS resources on specific pages in Grails 2.2.4? Currently, all JS files are being loaded on every page, even if they are not needed.
The configuration in my ApplicationResources
file is as follows:
modules = {
application {
dependsOn "jquery", "jquery-ui", "emberjs","emberjsdata", "pjax", "highchart", "filetype", "theme"
resource url:'js/application.js'
resource url:'js/App.js'
resource url:'js/bootstrap-select.js'
resource url:'js/bootstrap-switch.js'
}
request {
dependsOn "application"
resource url: 'js/request.js'
}
lowside {
dependsOn "application"
resource url:'js/lowside.js'
}
pjax {
resource url: 'js/jquery.pjax.js', disposition: "head"
}
highchart {
resource url: 'js/highcharts.js', disposition: "head"
}
filetype {
resource url: 'js/filestyle.js', disposition: "hea…
In my layout page, I include the following:
<r:require module="application"/>