我正在使用ngx管理模板(http://akveo.com/ngx-admin/#/pages/dashboard)
我的问题是,一开始,用于页面加载的微调器动画会旋转,并且加载页面时不会出现问题。当我进入其他更深的子链接时,例如localhost:4200 / Enter / Testpage,页面也会正常加载。但是,如果我再次在浏览器URL中单击“立即返回”,则微调器动画将无级旋转,而不会加载页面...
在我加载了原始根页面(localhost:4200)之后,它再次可以工作。 这似乎是一个老问题,因为我用Google搜索并且很多其他用户都遇到了同样的问题,但是没有一个线程可以帮助我解决我的问题... 我的带有旋转器的index.html看起来像:
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>ngx-admin Demo Application</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="icon" type="image/png" href="favicon.png">
<link rel="icon" type="image/x-icon" href="favicon.ico">
</head>
<body>
<ngx-app></ngx-app>
<style>@-webkit-keyframes spin{0%{transform:rotate(0)}100%{transform:rotate(360deg)}}@-moz-keyframes spin{0%{-moz-transform:rotate(0)}100%{-moz-transform:rotate(360deg)}}@keyframes spin{0%{transform:rotate(0)}100%{transform:rotate(360deg)}}.spinner{position:fixed;top:0;left:0;width:100%;height:100%;z-index:1003;background: #000000;overflow:hidden} .spinner div:first-child{display:block;position:relative;left:50%;top:50%;width:150px;height:150px;margin:-75px 0 0 -75px;border-radius:50%;box-shadow:0 3px 3px 0 rgba(255,56,106,1);transform:translate3d(0,0,0);animation:spin 2s linear infinite} .spinner div:first-child:after,.spinner div:first-child:before{content:'';position:absolute;border-radius:50%} .spinner div:first-child:before{top:5px;left:5px;right:5px;bottom:5px;box-shadow:0 3px 3px 0 rgb(255, 228, 32);-webkit-animation:spin 3s linear infinite;animation:spin 3s linear infinite} .spinner div:first-child:after{top:15px;left:15px;right:15px;bottom:15px;box-shadow:0 3px 3px 0 rgba(61, 175, 255,1);animation:spin 1.5s linear infinite}</style>
<div id="nb-global-spinner" class="spinner">
<div class="blob blob-0"></div>
<div class="blob blob-1"></div>
<div class="blob blob-2"></div>
<div class="blob blob-3"></div>
<div class="blob blob-4"></div>
<div class="blob blob-5"></div>
</div>
</body>
</html>
有人知道什么可以解决这个问题吗?
编辑:我刚刚看到,如果我在根链接之前放置“#”,例如:
http://localhost:4200/#/pages/test
,它通常还与微调器动画一起加载,但是我意识到,在此之后,浏览器URL很奇怪:http://localhost:4200/pages/test#/pages/test
,这可能与它有关吗?也许我把根路由链接设置错了,这就是为什么它不加载的原因?
EDIT2::控制台出现很多错误消息:
Refused to execute script from '<URL>' because its MIME type ('text/html') is not executable, and strict MIME type checking is enabled.
productsbydemomonth:1 Refused to execute script from 'http://localhost:4200/pages/runtime.js' because its MIME type ('text/html') is not executable, and strict MIME type checking is enabled.
productsbydemomonth:1 Refused to execute script from 'http://localhost:4200/pages/polyfills.js' because its MIME type ('text/html') is not executable, and strict MIME type checking is enabled.
productsbydemomonth:1 Refused to execute script from 'http://localhost:4200/pages/styles.js' because its MIME type ('text/html') is not executable, and strict MIME type checking is enabled.
productsbydemomonth:1 Refused to execute script from 'http://localhost:4200/pages/scripts.js' because its MIME type ('text/html') is not executable, and strict MIME type checking is enabled.
productsbydemomonth:1 Refused to execute script from 'http://localhost:4200/pages/vendor.js' because its MIME type ('text/html') is not executable, and strict MIME type checking is enabled.
productsbydemomonth:1 Refused to execute script from 'http://localhost:4200/pages/main.js' because its MIME type ('text/html') is not executable, and strict MIME type checking is enabled.
5productsbydemomonth:22 GET http://localhost:4200/pages/polyfills.js 404 (Not Found)