0

I need to get a json file which is on my local machine, but my baseUrl in Restangular is not localhost...

So, here is the question: Is it possible to get local file with Restangular.service when a base url is not localhost ?

And how can I do that?

Costa
  • 1
  • 2

2 Answers2

0

See this post : Local file access with javascript

It is not a problem with Restangular but with Javascript.

If you need it for test purpose you can try to find a way to do it (see the post)

If you are doing this in production, it is a bad practice. You should not access local machine from front-end

Community
  • 1
  • 1
Weedoze
  • 13,683
  • 1
  • 33
  • 63
0

Rather than using Restangular for this instance, I would just use a simple $http.get() operation.

mindparse
  • 6,115
  • 27
  • 90
  • 191