[英]Js reference is not loading correctly in Angular 6 application
I have developed a Angular 6 based web application. 我已经开发了一个基于Angular 6的Web应用程序。 But I am facing problem of loading js files correctly.
但是我面临正确加载js文件的问题。 I have deployed the site in firebase hosting ( https://dishari-d2728.firebaseapp.com/ ).
我已将网站部署在firebase托管( https://dishari-d2728.firebaseapp.com/ )中。
Interesting thing is when I visit first time all JS loads correctly but if I visit another page and again return to homepage, JS files is not working, and If I refresh several time everything is loaded correctly. 有趣的是,当我第一次访问所有JS时都正确加载,但是如果我访问另一页并再次返回首页,则JS文件无法正常工作,并且如果刷新几次,则所有文件都正确加载。 This is why I can't figure out where the actual problem is.
这就是为什么我不知道实际问题在哪里的原因。 I have referenced the JS files in the following way:
我已经通过以下方式引用了JS文件:
angular.json
angular.json
注册 appcomponent.ts
files using $GetScript()
function... $GetScript()
函数将脚本加载到appcomponent.ts
文件中...
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.