http.get request in agularJs controller works fine when my client app and api are in localhost. when api is moved to server., issue arised.
client side using angular
I've added the following constructor in my controller class
public function __construct($config = 'rest') { header('Access-Control-Allow-Origin: *'); header("Access-Control-Allow-Methods: GET, POST, OPTIONS, PUT, DELETE"); parent::__construct(); }