No 'Access-Control-Allow-Origin' header is present on the requested resource- angular js

I'm developing application using php codeigniter restful api as a server side and ionic framework for client side app, I'm trying to connect the client app with server api but i'm getting following issue

XMLHttpRequest cannot load http://localhost:90/mrk/index.php/MRKGeneral_api/user_login. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost:8100' is therefore not allowed access.

I used below code in client side,

$scope.signIn = function(form) {
        if(form.$valid) {
            var postData = { 'username' : $scope.authorization.username, 'password' : $scope.authorization.password };

            $http({
                url: "http://localhost:90/mrk/index.php/MRKGeneral_api/user_login", method: 'POST',
                data: postData,
                headers : {'Content-Type':'application/x-www-form-urlencoded; charset=UTF-8'}
            }).then(function(result) { 
                if(result.status == 200) {
                    if(result.data.success) {
                        GeneralService.userType = result.data.usertype;
                        GeneralService.userData = result.data;
                        $scope.errormsg = result.data.message;
                        $state.go('/app/dashboard');
                    } else {
                        $scope.errormsg = result.data.message;
                    }
                } else {

                }

            });

        }
    }

in my server side i have set header also like below,

header('Access-Control-Allow-Origin: *');
        header("Access-Control-Allow-Headers: X-API-KEY, Origin, X-Requested-With, Content-Type, Accept, Access-Control-Request-Method");
        header("Access-Control-Allow-Methods: GET, POST, OPTIONS, PUT, DELETE");
        $method = $_SERVER['REQUEST_METHOD'];
        if($method == "OPTIONS") {
            die();
        }

But still getting No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost:8100' is therefore not allowed access.

You need to allow cross domain call in your app config

app.config(function($httpProvider) {
    //Enable cross domain calls
    $httpProvider.defaults.useXDomain = true;
});