How to call api in angularjs?

This is my controller where i am passing .username,.password to services

var value=loginService.login($scope.username,$scope.password);

In services

.service(‘loginService’, [’$resource’, function($resource){
this.login = function() {}

in these i get login undefined error pls anyone help me

I recommend checking out our example app for AngularJS, which covers login among other things. Take a look at how it’s implemented there, and carry that over to your own app.