gpt4 book ai didi

javascript - ionic 服务 : Displays code only for a split second

转载 作者:行者123 更新时间:2023-11-28 05:26:21 25 4
gpt4 key购买 nike

我的代码在返回 ionic 服务后仅显示一瞬间并变为空白。我拥有运行这个程序所需的一切,如nodejs、cordova、ionic、jdk 等。我是 ionic 新手,如果有人能帮助我解决这个问题,我将不胜感激。这是在 Internet Explorer 上运行的。

enter image description here

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="initial-scale=1, maximum-scale=1, user-scalable=no, width=device-width">
<title></title>

<link rel="manifest" href="manifest.json">

<!-- un-comment this code to enable service worker
<script>
if ('serviceWorker' in navigator) {
navigator.serviceWorker.register('service-worker.js')
.then(() => console.log('service worker installed'))
.catch(err => console.log('Error', err));
}
</script>-->

<link href="lib/ionic/css/ionic.css" rel="stylesheet">
<link href="css/style.css" rel="stylesheet">

<!-- IF using Sass (run gulp sass first), then uncomment below and remove the CSS includes above
<link href="css/ionic.app.css" rel="stylesheet">
-->

<!-- ionic/angularjs js -->
<script src="lib/ionic/js/ionic.bundle.js"></script>

<!-- cordova script (this will be a 404 during development) -->
<script src="cordova.js"></script>

<!-- your app's js -->
<script src="js/app.js"></script>
<script src="js/controllers.js"></script>
<script src="js/services.js"></script>
</head>
<body ng-app="starter">
<h1>asdf</h1>
<!--
The nav bar that will be updated as we navigate between views.
-->
<ion-nav-bar class="bar-stable">
<ion-nav-back-button>
</ion-nav-back-button>
</ion-nav-bar>
<!--
The views will be rendered in the <ion-nav-view> directive below
Templates are in the /templates folder (but you could also
have templates inline in this html file if you'd like).
-->
<ion-nav-view></ion-nav-view>
</body>
</html>

最佳答案

你真的很失落。如果你尝试展示

<h1>asdf</h1>

好吧,它消失了,因为被代码中的 Angular 应用程序取代了

    <!-- your app's js -->
<script src="js/app.js"></script>
<script src="js/controllers.js"></script>
<script src="js/services.js"></script>

你确实用 angularjs 编写了你的​​代码,你可以查看 angular 的文档和 ionic .

你可以退役主体类并直接写入索引,但这是非常糟糕的方法

关于javascript - ionic 服务 : Displays code only for a split second,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40133750/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com