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",
|
"$schema": "./node_modules/@angular/cli/lib/config/schema.json",
|
||||||
"version": 1,
|
"version": 1,
|
||||||
"cli": {
|
"cli": {
|
||||||
"packageManager": "npm"
|
"packageManager": "npm",
|
||||||
|
"analytics": false
|
||||||
},
|
},
|
||||||
"newProjectRoot": "projects",
|
"newProjectRoot": "projects",
|
||||||
"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 {
|
ngAfterViewInit(): void {
|
||||||
// Load SVG file and inject it into the component
|
// 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) => {
|
next: (svgContent) => {
|
||||||
const container = this.elementRef.nativeElement.querySelector('.svg-container');
|
const container = this.elementRef.nativeElement.querySelector('.svg-container');
|
||||||
if (container) {
|
if (container) {
|
||||||
|
|||||||
Reference in New Issue
Block a user