Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/ionic-framework/2.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
Angularjs Ionic标题包含查看内容_Angularjs_Ionic Framework_Web Applications_Angular Ui Router - Fatal编程技术网

Angularjs Ionic标题包含查看内容

Angularjs Ionic标题包含查看内容,angularjs,ionic-framework,web-applications,angular-ui-router,Angularjs,Ionic Framework,Web Applications,Angular Ui Router,我无法在我的应用程序中容纳标题。class=“has header”显然已经过时,我需要帮助找到替代方案。 谢谢 请随意纠正任何其他问题 index.html: <!DOCTYPE html> <html> <head> <meta charset="utf-8"> <meta name="viewport" content="initial-scale=1, maximum-scale=1, user-scalable=

我无法在我的应用程序中容纳标题。
class=“has header”
显然已经过时,我需要帮助找到替代方案。 谢谢

请随意纠正任何其他问题

index.html:

<!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 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="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.7/angular-route.js"></script>
    <script> 
var Hours = angular.module('Hours', ['ngRoute']);

Hours.config(['$routeProvider',
  function($routeProvider) {
    $routeProvider.
      when('/', {
        templateUrl: '1.html',
    }).
      when('/dininghalls', {
        templateUrl: '2.html',
    }).
      when('/fitnesscenters', {
        templateUrl: '3.html'
      }).
      when('/officehours', {
        templateUrl: '4.html'
      }).
      otherwise({
        redirectTo: '/'
      });
}]);
 </script>
  </head>
  <body ng-app="Hours">
        <div ng-view=""></div>
  </body>
</html>

var小时=角度。模块('Hours',['ngRoute']);
Hours.config(['$routeProvider',
函数($routeProvider){
$routeProvider。
当(“/”{
templateUrl:'1.html',
}).
当(“/dininghalls”{
templateUrl:'2.html',
}).
当(“/FitnessCenter”{
templateUrl:'3.html'
}).
当(“/办公时间”{
templateUrl:'4.html'
}).
否则({
重定向到:'/'
});
}]);
1.html:

<ion-header-bar align-title="left" class="bar-positive">
<div class="bar bar-header bar-stable">
  <h1 class="title">Hours</h1>
</div>
</ion-header-bar>


<ion-content>
<a href="#/4" class="button button-block button-positive">
Hours
</a>
<a href="#/2" class="button button-block button-positive">
Halls
</a>
<a href="#/3" class="button button-block button-positive">
Fitness 
</a>
</ion-content>

小时
has header=“true”
添加到您的ion内容中(看起来文档中可能缺少该内容?)。您也不应该在
中需要
class=“header bar”

更新: 您需要在模块中插入依奥尼亚作为依赖项。

您需要将
更改为

……将class=“has header”添加到您的ContainerHanks中,但我特别指出,不再支持使用class=“has header”。还有其他想法吗?为什么在离子标题栏里面有一个.标题栏?嘿,我知道已经有一段时间了,但我一直很忙,只是试了试你说的。它仍然不起作用。还有其他建议吗?我删除了class=“header bar”并将has header=“true”添加到我的ion内容中,但仍然没有任何效果。好吧,准备好最令人沮丧的答案:你需要在你的模块
Hours
中作为依赖项注入
ionic
。是的,这是必要的-我启动了一个空白项目,并尝试了它,有依赖性和没有依赖性,这是绝对必要的-将不得不调查来源,以找出原因,但它肯定是。让我知道,如果这没有解决你的问题。如果有,请接受它作为答案!这就意味着“爱奥尼亚”会出现在“ngRoute”旁边,对吗?