Loopback rest api connect to ionic

I created front-end using ionic and also created all the back-end restful api using loopback framework.I search everywhere but i didn’t find.I confused about writing controller.js and service.js for login page.help me.