瀏覽代碼

🐛 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';