Generates a Javascript object that lets you refer to your application's routes in Javascript code
Generates a Javascript object that lets you refer to your application's routes in Javascript code
Example:
@javascriptRouter("jsRoutes")( routes.javascript.Users.list, routes.javascript.Application.index )
Now you can access your routes in JavaScript without hardcoded URL's, e.g.:
jsRoutes.controllers.Users.list().ajax({success: /* ... */ error: /* ... */)
Each action in the generated object has the following keys: * *ajax*: lets you perform a jQuery ajax call to that actiomn * *method*: HTTP method * *url*
The javascript object name.
Set of routes to include in this javascript router.
Generates a Javascript object that lets you refer to your application's routes in Javascript code
Example:
Now you can access your routes in JavaScript without hardcoded URL's, e.g.:
Each action in the generated object has the following keys: * *ajax*: lets you perform a jQuery ajax call to that actiomn * *method*: HTTP method * *url*