I want to use the angularJs Template value in spring Controller.
If it is like
ng-model=x
and we show the data with {{x}}
how can I use this x value in a Spring Rest Controller's method as a parameter?
I have solved the Issue .
Here is the Answer:
if in AngularJs( in the HTML templete) is {{x}}
then in spring RestController we can use with @RequestParam
Therefore ,
@RequestMapping(value = "/TheAddress",
method = RequestMethod.POST,
produces = MediaType.APPLICATION_JSON_VALUE)
@Timed
public TheName(@RequestBody String anystring,
@RequestParam("x") String asThevaliableToUseInTheControler) {
//The code
}
x
as parameter to controller.@RequestParam
,@PathVariable
,@RequestBody
etc ...