I have defined a $http.get method, and the problem is that if I do not provide it with a JSONP response, it cannot parse the result, anyone know a way to use JSON REST service? I don't want to burden the server with JSONP transformation of results.
Thanks!
[MY SERVICE CLASS]
class PostService
constructor: ($log, $http) ->
urlBase = 'api/posts'
PostService::get = ($log)->
$http.get(urlBase).then((result) ->
result.data
)
angular.module('app').service 'postService', ['$log', '$http', PostService]
[MY CONTROLLER CLASS]
class PostController
constructor:($log, $location, $scope,postService) ->
setPosts = =>
postService.get($log).then (result) =>
$scope.posts = result
setPosts()
angular.module('app').controller 'postController', ['$log', '$location', '$scope','postService', PostController]