itsMe
itsMe

Reputation: 785

JHipster- Connecting Spring controller to angular js button

I have an application, where a button must call a spring controller. How do I connect them together? I have not found any clear information yet.

Upvotes: 0

Views: 221

Answers (1)

Sharan De Silva
Sharan De Silva

Reputation: 608

Directly call your API in href in <a> tag

API : http://192.168.1.17:8080/product/download/excel

<a href="/product/download/excel" > Start Download </a>

Controller :

@RequestMapping(value="/product/download/excel", method=RequestMethod.GET)
    public Object downloadExcel(HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse){
        return productService.downloadExcel(httpServletRequest,httpServletResponse);
    }

Upvotes: 2

Related Questions