소스 검색

🐛 fix assets path

jmacura 3 년 전
부모
커밋
c3b1b491e3
3개의 변경된 파일5개의 추가작업 그리고 1개의 파일을 삭제
  1. 1 1
      src/app/app.component.html
  2. 3 0
      src/app/app.component.ts
  3. 1 0
      src/app/sdm-dih.service.ts

+ 1 - 1
src/app/app.component.html

@@ -103,7 +103,7 @@ Link to the “The Policy Options Explorer” (pages of Runar and Antoni, or sep
       this purpose, we adapted the Rural Attractiveness Index to fit with the Policy Options Explorer as follows
       (notably, the version of the Rural Attractiveness Index used here consists of only 4 instead of 6 sub-indices):
       <figure>
-        <img src="../assets/rai-composition.png" class="img-fluid">
+        <img src="{{assetsPath}}rai-composition.png" class="img-fluid">
         <figcaption>Composition of the Rural Attractiveness Index used in the Rural Attractiveness Explorer</figcaption>
       </figure>
     </p>

+ 3 - 0
src/app/app.component.ts

@@ -11,6 +11,9 @@ import {SdmDihService} from './sdm-dih.service';
 })
 export class AppComponent {
   offcanvasRef;
+  assetsPath = window.location.hostname.includes('localhost')
+    ? '../assets/'
+    : './assets/';
 
   constructor(
     private offcanvasService: NgbOffcanvas,

+ 1 - 0
src/app/sdm-dih.service.ts

@@ -1,6 +1,7 @@
 import {BehaviorSubject} from 'rxjs';
 import {HttpClient} from '@angular/common/http';
 import {Injectable} from '@angular/core';
+
 import {csv} from 'd3';
 
 import vars2facts from '../assets/data/variables2factors.json';