簡體   English   中英

Font Awesome 和 JQuery 在單個 SPA Angular 應用程序中不起作用

[英]Font Awesome and JQuery are not working in Single SPA Angular app

我創建了一個單水療中心 angular 應用程序,我在其中安裝了 font-awesome 和 jquery 並使用“npm install --save bootstrap jquery@3.4.1 font-awesome”進行引導。 After that i have provided the url of this js and css inside angular.json file so the problem i am facing is jquery and font-awesome working fine when I am running this application in normal angular mode but the problem occur when i try to run此應用程序在單水療模式下。 In single-spa mode jQuery and font-awesome not working but i am not able to understand that my bootstrap style is working but why i am facing problem with font-awesome even i have provided the font-awesome url in angular.json file in就像我為引導程序提供 url 一樣。

注意:我通過在現有 angular 應用程序的根文件夾中運行“ng add single-spa-angular”命令創建了這個單一的 spa angular 應用程序。

我們可以使用“ng serve -o”命令在正常的 angular 模式下運行應用程序。 但是要在單水療模式下運行這個應用程序,我們必須運行這個命令“npm run serve:single-spa:”。

謝謝

這里有2個解決方案

  • main.single-spa.ts文件中導入 Jquery。
  • 或將 JQuery 添加為根配置應用程序中的共享依賴項

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM