I've gone through few posts and articles but it doesnt work for me. I am looking the working solution.
Problem:- $http.get making additional call i.e OPTIONS whenever i call my service.
Ex: website: http://locahost:4020/dashboard
Api: http://locahost:3020/filters
app.config(['$httpProvider', function ($httpProvider) {
$httpProvider.defaults.useXDomain = true delete $httpProvider.defaults.headers.common['X-Requested-With']
//$httpProvider.defaults.headers.common['X-Requested-With'] = 'XMLHttpRequest' //Reset headers to avoid OPTIONS request
$httpProvider.defaults.headers.common = {}
$httpProvider.defaults.headers.post = {}
$httpProvider.defaults.headers.put = {}
$httpProvider.defaults.headers.patch = {}
$httpProvider.defaults.headers.get = {} } ])
$http.get(url + '?' + $.param(args || ''), req)
http://locahost:3020/filters is failing to return data whenever i call since OPTIONS call is going on before actually api call(get).