Fix: Move SVG to public folder for Angular 21 asset serving
This commit is contained in:
@@ -2,7 +2,8 @@
|
||||
"$schema": "./node_modules/@angular/cli/lib/config/schema.json",
|
||||
"version": 1,
|
||||
"cli": {
|
||||
"packageManager": "npm"
|
||||
"packageManager": "npm",
|
||||
"analytics": false
|
||||
},
|
||||
"newProjectRoot": "projects",
|
||||
"projects": {
|
||||
|
||||
|
Before Width: | Height: | Size: 1.2 MiB After Width: | Height: | Size: 1.2 MiB |
@@ -14,7 +14,7 @@ export class MapSvgComponent implements AfterViewInit {
|
||||
|
||||
ngAfterViewInit(): void {
|
||||
// Load SVG file and inject it into the component
|
||||
this.http.get('assets/map-image.svg', { responseType: 'text' }).subscribe({
|
||||
this.http.get('map-image.svg', { responseType: 'text' }).subscribe({
|
||||
next: (svgContent) => {
|
||||
const container = this.elementRef.nativeElement.querySelector('.svg-container');
|
||||
if (container) {
|
||||
|
||||
Reference in New Issue
Block a user