All JSbin images broken
lexi89 opened this issue · 3 comments
lexi89 commented
Looks like JSbin won't load images.
To recreate:
Open any of the JSbins with SVG images and open console
Sample error message:
Error: [$sce:insecurl] http://errors.angularjs.org/1.4.9/$sce/insecurl?p0=https%3A%2F%2Frawgit.com%2Fangular%2Fmaterial-start%2Fes5-tutorial%2Fapp%2Fassets%2Fsvg%2Favatars.svg
at Error (native)
at https://cdnjs.cloudflare.com/ajax/libs/angular.js/1.4.9/angular.min.js:6:416
at getTrusted (https://cdnjs.cloudflare.com/ajax/libs/angular.js/1.4.9/angular.min.js:141:36)
at Object.c.(anonymous function) [as getTrustedResourceUrl] (https://cdnjs.cloudflare.com/ajax/libs/angular.js/1.4.9/angular.min.js:142:289)
at e (https://cdnjs.cloudflare.com/ajax/libs/angular.js/1.4.9/angular.min.js:144:237)
at https://rawgit.com/angular/bower-material/master/angular-material.min.js:15:13645
at new C (https://cdnjs.cloudflare.com/ajax/libs/angular.js/1.4.9/angular.min.js:123:1)
at C (https://cdnjs.cloudflare.com/ajax/libs/angular.js/1.4.9/angular.min.js:122:484)
at d (https://rawgit.com/angular/bower-material/master/angular-material.min.js:15:13452)
at h (https://rawgit.com/angular/bower-material/master/angular-material.min.js:15:13687)
topherfangio commented
Thanks @lexi89! We're aware of the issue and should have a fix coming soon.
In the meantime, you can add the following to your JSBins just after the angular.module()
declaration to get the images loading properly:
// NOTE: The following config is required because we're loading this within JSBin
.config(function($sceDelegateProvider) {
$sceDelegateProvider.resourceUrlWhitelist([
// Allow same origin resource loads.
'self',
// Allow loading from our assets domain. Notice the difference between * and **.
'https://rawgit.com/angular/material-start/es5-tutorial/app/assets/svg/**'
])
})
topherfangio commented
Fixed. Many thanks to @ThomasBurleson for updating all of the JSBins with the appropriate code!
barstromza commented
I still get this error for angular material version 1.1.4 - is it really fixed?