you want to use the builtin $http service to make the call to the server. For some sugar you have the option of using the $resource service which wraps the $http service. Ideally you'd create a method in a service of your own making to call from your controller..
my controller (with my service injected)
angular.module 'app'
.controller 'RegisterFormCtrl', (UsersService) ->
UsersService.create(@details)
.then()....
my service (with my resource injected)
angular.module('app')
.factory 'UsersService', (UsersResource) ->
new class
constructor: ->
@response = null
# register
create: (user) ->
UsersResource.save(user).$promise
my resource
angular.module('app')
.factory "UsersResource", (Resty) ->
Resty "/api/users/:id", {id: '@id'}
.factory "UserKeysResource", ($resource) ->
$resource "/api/userkeys"
my resource actually uses another service of mine which uses the angular $resource service..
angular.module('app')
.factory "Resty", ($resource) ->
(url, params, methods, options) ->
methods = angular.extend {
update:
method: 'PUT'
create:
method: 'POST'
}, methods
options = angular.extend { idAttribute: 'id' }, options
resource = $resource url, params, methods
resource.prototype.$save = () ->
if this[options.idAttribute]
this.$update.apply this, arguments
else
this.$create.apply this, arguments
resource
ok, so the bare minimum alternative implementation, in your controller, would be the following..
.controller('tableCtrl', [
'$scope', '$filter', '$http',
($scope, $filter, $http) ->
# filter
$http.get('/someUrl').
success(
(data, status, headers, config) ->
# this callback will be called asynchronously
# when the response is available
$scope.stores = data
).
error(
(data, status, headers, config) ->
# called asynchronously if an error occurs
# or server returns response with an error status.
)
])