Error with $http post

Hi There

I am getting the following error when doing an $http post.

Response for preflight has invalid HTTP status code 405
405 (Method Not Allowed)

The message returned from the server is as follows
{“message”:“The requested resource does not support http method ‘OPTIONS’.”}

I am able to post to the service using postman successfully so I am not sure why its not working from IONIC.

My Service

.service('Authentication', ['$http', function($http){

    var api_url = '';
    var ret = {
        register: function(data){
            return $, data).then(function(resp){
    return ret;


A bit dated, but I found this SO solution: