There is a website written on angular, using rest api, api gives json, ngresource takes, everything is fine, as long as all the action takes place on one server.
Ngresource works on ajax, therefore, when trying to receive or send data to another server, there will be an error in the rights. You can use jsonP, but then you have to rewrite
var resource = $resource(url, {callback: "JSON_CALLBACK"}, { get: {method: "JSONP"} } ); The whole meaning of rest api is traced, the post, get, delete, put headers are used there.
And the question appeared when I tried to assemble a mobile application in cordova + ionic.
You can, of course, cut down Access-Control-Allow-Origin on the server.
<?php header('Access-Control-Allow-Origin: *'); ?> If someone knows the correct way, tell me.
'Access-Control-Allow-Origin: localhost:8100'Did you try to start the already assembled application? - Grundy