简体   繁体   English

离子服务:仅在瞬间显示代码

[英]Ionic Serve: Displays code only for a split second

My code is only shown for a split second after returning ionic serve and goes blank. 我的代码仅在返回离子发送后显示一秒钟并且变为空白。 I've everything needed to run this like nodejs, cordova, ionic, jdk, etc. I'm new to ionic and would appreciate if someone can help me solve this. 我已经做了所有需要运行的东西,如nodejs,cordova,ionic,jdk等。我是离子的新手,如果有人可以帮我解决这个问题,我将不胜感激。 This was run on internet explorer. 这是在Internet Explorer上运行的。

在此输入图像描述

 <!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> 

really you are very lost. 你真的很迷茫。 if you try to show 如果你试图表明

<h1>asdf</h1>

well that disappear because is replaced by the angular app in your code 好消失,因为代码中的角度应用程序取代了

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

you do write your in angularjs for that you can check the docs of angular and ionic . 你确实在angularjs中写了你可以检查角度离子的文档。

you can retire the class of body and write direct in index but that is the really bad way 你可以退出身体类并直接写入索引,但这是非常糟糕的方式

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM