Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/404.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 爱奥尼亚:问题开始:1)CSS 2)爱奥尼亚服务3)代码笔_Javascript_Css_Angularjs_Cordova - Fatal编程技术网

Javascript 爱奥尼亚:问题开始:1)CSS 2)爱奥尼亚服务3)代码笔

Javascript 爱奥尼亚:问题开始:1)CSS 2)爱奥尼亚服务3)代码笔,javascript,css,angularjs,cordova,Javascript,Css,Angularjs,Cordova,问题1)离子css效应 这就是我在移动/模拟器上看到的——Ionic和它的css在html上似乎不起作用 我遵循了这里的教程(参见相同的代码),但标题没有格式化 要点如下: 以下是index.html代码: <!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>Todo</title> <meta name="viewpo

问题1)离子css效应

这就是我在移动/模拟器上看到的——Ionic和它的css在html上似乎不起作用

我遵循了这里的教程(参见相同的代码),但标题没有格式化

要点如下:

以下是index.html代码:

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

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

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

    <!-- Needed for Cordova/PhoneGap (will be a 404 during development) -->
    <script src="js/app.js"></script>
    <script src="cordova.js"></script>
  </head>
  <body ng-app="todo">
    <ion-side-menus>

      <!-- Center content -->
      <ion-side-menu-content>
        <ion-header-bar class="bar-dark">
          <h1 class="title">Todo</h1>
        </ion-header-bar>
        <ion-content>
        </ion-content>
      </ion-side-menu-content>

      <!-- Left menu -->
      <ion-side-menu side="left">
        <ion-header-bar class="bar-dark">
          <h1 class="title">Projects</h1>
        </ion-header-bar>
      </ion-side-menu>
    </ion-side-menus>
  </body>
</html>

待办事项
待办事项
项目
下面是js/app.js代码:

// Ionic Starter App

// angular.module is a global place for creating, registering and retrieving Angular modules
// 'starter' is the name of this angular module example (also set in a <body> attribute in index.html)
// the 2nd parameter is an array of 'requires'
//angular.module('starter', ['ionic'])
angular.module('todo', ['ionic']);

.run(function($ionicPlatform) {
  $ionicPlatform.ready(function() {
    // Hide the accessory bar by default (remove this to show the accessory bar above the keyboard
    // for form inputs)
    if(window.cordova && window.cordova.plugins.Keyboard) {
      cordova.plugins.Keyboard.hideKeyboardAccessoryBar(true);
    }
    if(window.StatusBar) {
      StatusBar.styleDefault();
    }
  });
})
//Ionic Starter应用程序
//angular.module是创建、注册和检索angular模块的全局位置
//“starter”是此角度模块示例的名称(也在index.html中的属性中设置)
//第二个参数是“requires”的数组
//角度模块('starter',['IONAL']))
角模('todo',['IONAL']);
.run(函数($ionicPlatform){
$ionicPlatform.ready(函数(){
//默认情况下隐藏附件栏(删除此选项可在键盘上方显示附件栏)
//表格输入)
if(window.cordova&&window.cordova.plugins.Keyboard){
插件键盘hideKeyboardAccessoryBar(真);
}
如果(窗口状态栏){
StatusBar.styleDefault();
}
});
})
问题2)同样,当我尝试跑步时

离子发球

localhost:8100
gives
无法获取

localhost:8100/index.html
gives
无法获取/index.html

问题3)

对于Ionic

但是,如果我尝试从头开始(比如从文档中拿出一些代码片段),Ionic就不起作用了:

我还尝试了“todo”教程代码(包括头标记include.css链接,Codepen说这是不必要的)


谢谢你的帮助

我不知道如何解决您当前使用Ionic任务运行程序/工具时遇到的问题,但我可以概述一下我使用Ionic运行程序的方法

我在使用Ionic时也遇到问题,并放弃了上所述的设置

我所做的是用脚手架工具安装一个angular应用程序,并通过bower
bower安装ionic
添加了ionic

然后,我使用Grunt服务,在Google Chrome开发工具中使用移动仿真()查看/调试我的Ionic应用程序,以更快地进行测试

当我需要测试我的应用程序时,我会运行一个Grunt任务,将我的所有应用程序资产复制到Cordova/PhoneGap应用程序,然后构建并部署到这些设备/模拟器