Ng-include cross-domain help angularjs

I have a nightmare trying to implement a whitelist for URLs that load into the ng-include cross domain.

I have an include that works fine locally:

<div ng-include="'http://test-domain.com/framework/includes/main-menu.html'"></div>

Then I added the whitelist so ...

angular.module('myApp', ['ngRoute','ngResource'])
.config(function($sceDelegateProvider) {
  $sceDelegateProvider.resourceUrlWhitelist([
    // Allow same origin resource loads.
    'self',
    // Allow loading from our assets domain.  Notice the difference between * and **.
    'http://test-domain.com/framework/includes/**'
  ]);
});

But I'm still getting "XMLHttpRequest cannot load" errors in all browsers. It drives me crazy, is there any way around this? Did I miss something else to get this to work in the cross domain? Please help. Thanks

+3
source share

All Articles