Render a Play!Framework2 javascript as template?

后端 未结 3 1930
攒了一身酷
攒了一身酷 2021-01-07 03:00

I\'d like to return a .js file from a template in Play!Framework 2.

Here\'s how I did that :

In my views folder, I created a template file :

         


        
3条回答
  •  借酒劲吻你
    2021-01-07 03:38

    This is possible by placing a route to the particular asset in your routes definition.

    ie. GET /assets/javascripts/initials.js controllers..initials()

提交回复
热议问题