0

I am in the process of learning angular and I am a little confused as to what the difference is between cross domain and same domain requests. How do you know which type of request you are making?

New Dev
  • 48,427
  • 12
  • 87
  • 129
nehas
  • 247
  • 2
  • 5
  • 18
  • has nothing to to with angularjs. cross domain is when your script is loaded from domain A and is requesting a resource from domain B. the same domain request is obviously A instead of B. – webduvet May 17 '15 at 16:13
  • possible duplicate of [Understanding CORS](http://stackoverflow.com/questions/25845203/understanding-cors) – Claies May 17 '15 at 16:28

1 Answers1

1

Angularjs is a front end framework. You need a server component(rails, node.js etc) to handle requests from angularjs and handle the data(Users, post, comments etc). If you are developing an Angularjs application that sends a request to a server that is NOT located with in the same domain/website, then it is a cross domain request. If you are developing an Angularjs application using a server that is contained with in the same domain/website, then it is a same domain request. If you want to develop an Angualrjs application using cross domain requests, you need to learn Cross-origin resource sharing(CORS) which defines how the server handles request from another domain/website.

Luis Menjivar
  • 777
  • 4
  • 10