我已经学习了3天用离子框架创建移动应用程序。
我最初使用html和css为每个页面创建,在文件index.html中我想添加一个侧面菜单。然后我添加代码,最后它工作..
但是,我遇到了问题。 ..没有出现在标题下..
我不知道为什么内容没有出现,因为在我添加之前,内容会出现。
这是我的代码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">
<!-- ionic/angularjs js -->
<script src="lib/ionic/js/ionic.bundle.js"></script>
<!-- your app's js -->
<script src="js/app.js"></script>
</head>
<body ng-app="starter">
<ion-side-menus>
<ion-side-menu-content>
<ion-header-bar class="bar-header bar-dark">
<button class="button button-clear button-positive">Edit</button>
<div class="h1 title">23 Desember 20014</div>
<button class="button button-icon icon ion-navicon" menu-toggle="right"> </button>
</ion-header-bar>
</ion-side-menu-content>
<ion-side-menu side="right">
<a menu-close href="#/home" class="item">Home</a>
<a menu-close href="#/home" class="item">Home</a>
<a menu-close href="#/home" class="item">Home</a>
</ion-side-menu>
</ion-side-menus>
<!-- NOT APPEAR -->
<ion-content>
<div class="row green">
<div class="col">Saldo</div>
<div class="col price">9,735,000</div>
</div>
<div class="row light-green">
<div class="col">Income</div>
<div class="col price">3,550,000</div>
</div>
<div class="row pink expense-now">
<div class="col"><strong>Expense</strong></div>
</div>
</ion-content>
<!-- NOT APPEAR -->
</body>
</html>
这是我的代码app.js:
// Ionic Starter App
angular.module('starter', ['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();
}
});
})
function ContentController($scope, $ionicSideMenuDelegate) {
$scope.toggleLeft = function() {
$ionicSideMenuDelegate.toggleLeft();
};
}
请帮我解决这个案子, 提前致谢, 问候
答案 0 :(得分:0)
如果您查看侧边菜单(http://ionicframework.com/docs/api/directive/ionSideMenus/)和演示文档(http://codepen.io/ionic/pen/tcIGK)的文档,看起来您的内容需要 in 离子端 - 标签,不在外面,因为你在这里。
Stackoverflow不允许我提交没有代码的CodePen网址,因此我只是为了让它关闭而添加代码。
<ion-side-menus>
<!-- Center content -->
<ion-side-menu-content ng-controller="ContentController">
</ion-side-menu-content>
<!-- Left menu -->
<ion-side-menu side="left">
</ion-side-menu>
<!-- Right menu -->
<ion-side-menu side="right">
</ion-side-menu>
</ion-side-menus>