2017-04-12 65 views
0

enter image description here我已經建立了我的Angular2應用程序,一切工作正常。現在我包含了font-awesome,當我捆綁應用程序時,它會顯示圖片中顯示的錯誤。它無法加載woff和woff2文件。 我的風格看起來像下面 -Angular-cli-無法捆綁字體真棒

  "styles": [ 
     "styles.css", 
      "../node_modules/font-awesome/css/font-awesome.css", 
      "../node_modules/primeng/resources/primeng.min.css", 
    "../node_modules/primeng/resources/themes/omega/theme.css", 
    "../node_modules/fullcalendar/dist/fullcalendar.css", 
    "../node_modules/bootstrap/dist/css/bootstrap.min.css" 
     ], 

enter image description here

+0

修復圖片在哪裏? – Aravind

+0

剛更新了它。 – indra257

+0

你必須在你的問題中包括你如何將它導入你的模塊或人們無法幫助。 – developer033

回答

0

AS的文件夾結構在近角的版本,你應該是指一個錯誤的路徑改變由

"styles": [ 
    "styles.css", 
     "node_modules/font-awesome/css/font-awesome.css", 
     "node_modules/primeng/resources/primeng.min.css", 
     "node_modules/primeng/resources/themes/omega/theme.css", 
     "node_modules/fullcalendar/dist/fullcalendar.css", 
     "node_modules/bootstrap/dist/css/bootstrap.min.css" 
    ], 
+0

但是,當我執行服務並且所有圖標都正確顯示時,它工作正常,控制檯也是空的。這個問題只有在我編譯時纔會出現。 – indra257

+0

你試過這個答案嗎? – Aravind

+0

是的。它會拋出錯誤。因爲它無法解決相對路徑。此外,我還將Project結構截圖添加到了供參考的問題中。 – indra257