1.Below is the code which has error for cross domain (CORS). Tried a lot but not able to figure out the mistake please help. The code is in AngularJS the error is "phome1.html:78:7 Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at http://dev.markitondemand.com/MODApis/Api/v2/Lookup/json?input=. (Reason: CORS header ‘Access-Control-Allow-Origin’ missing)."
<script>
        (function() {
          'use strict';
          var app=angular.module('MyApp');
        app.config(['$httpProvider', function($httpProvider) {
                $httpProvider.defaults.useXDomain = true;
                delete $httpProvider.defaults.headers.common['X-Requested-With'];
          }]);
    // Added all header request and response.
        app.controller('DemoCtrl', DemoCtrl);
      function DemoCtrl($scope,$http) {
        var self = this;
        //document.write("hello");
        self.data = null;
        self.selectedItem = null;
        self.searchText = null;
        self.querySearch = function (query) {
          //document.write();
          console.log(escape(query));
          $http.get('http://dev.markitondemand.com/MODApis/Api/v2/Lookup/json?input=a').then(function(result) {
              console.log(result);
            });
        }
      }
    })();
        </script>
 
    