This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# If you have an API that returns JSON but want the reponse as raw text you | |
# can override Angulars built in JSON response parser by using an identity | |
# function as response transformer function | |
$http.get("/myapi", | |
{ transformResponse: (d, h) -> return d } # return raw response | |
) | |
.success((data, status, headers) -> | |
# data is now pure text | |
alert("Response is text: #{angular.isString(data)}") |
OlderNewer