angular / in-memory-web-api

The code for this project has moved to the angular/angular repo. This repo is now archived.
MIT License
1.18k stars 232 forks source link

HttpClientInMemoryWebApiModule disabling svg mat-icon #195

Open viniciusmiguel opened 6 years ago

viniciusmiguel commented 6 years ago

When configuring the InMemoryWebAPI SVG icons cannot be loaded using

iconRegistry.addSvgIcon('icon', sanitizer.bypassSecurityTrustResourceUrl('iconurl.svg')); I tried to configure with apiBase parameter but without success.

Console: Error retrieving icon: undefined

The InMemoryWebAPI must ignore other urls outside API URL scope.

rkorrelboom commented 6 years ago

Try the passThruUnknownUrl option to allow the request to pass through to the actual asset:

HttpClientInMemoryWebApiModule.forRoot(InMemoryApiService, {
      passThruUnknownUrl: true
})