Skip to content

Instantly share code, notes, and snippets.

@kmaida
Last active August 29, 2015 14:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kmaida/e7f2b56ce098dc8836ca to your computer and use it in GitHub Desktop.
Save kmaida/e7f2b56ce098dc8836ca to your computer and use it in GitHub Desktop.
AngularJS 1.2+ - Config to whitelist subdomains on the same root domain
var urlDomain = window.location.hostname.replace('www.', '');
app.config('$sceDelegateProvider', function($sceDelegateProvider) {
$sceDelegateProvider.resourceUrlWhitelist([
'self',
'http://*.' + urlDomain + '/**'
]);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment