0
我開始了一個離子項目。它不適合我。我正在爲所有視圖做一個側面菜單。我想要一個快速重播。在ion-nav-view的索引頁面我可以填充它的內容也顯示了output.but我要顯示在menulayout.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 rel="manifest" href="manifest.json">
<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="app/app.js"></script>
</head>
<body ng-app="starter">
<ion-pane>
<ion-nav-view>
</ion-nav-view>
</ion-pane>
</body>
</html>
app.js
angular
.module('starter', ['ionic'])
.run([ '$ionicPlatform', function($ionicPlatform) {
$ionicPlatform.ready(function() {
if(window.cordova && window.cordova.plugins.Keyboard) {
if (cordova.plugins.Keyboard.hideKeyboardAccessoryBar) {
cordova.plugins.Keyboard.hideKeyboardAccessoryBar(true);
}
cordova.plugins.Keyboard.disableScroll(true);
}
if(window.StatusBar) {
StatusBar.styleDefault();
}
});
}])
.config(function($stateProvider, $urlRouterProvider, $ionicConfigProvider) {
$ionicConfigProvider.backButton.previousTitleText(false).text('');
$stateProvider
.state('app',{
abstract:true,
url: "/app",
templateUrl:"app/layout/menulayout.html"
})
.state('app.home', {
url: "/home",
views:{
'mainContent':{
templateUrl: 'app/ast/home.html'
}
}
})
.state('app.login', {
url: "/login",
views:{
'mainContent':{
templateUrl: 'app/ast/login.html'
}
}
});
$urlRouterProvider.otherwise('/home');
});
menulayout.html
<ion-side-menus>
<ion-pane ion-side-menu-content>
<ion-nav-bar class="bar-dark" align-title='center'>
<ion-nav-title align-title='center'>Home</ion-nav-title>
<ion-nav-back-button class="button-icon button-clear">
<i class="ion-arrow-left-c energized"></i>
</ion-nav-back-button>
<ion-nav-buttons side="left">
<button menu-toggle="left" class="button button-icon button-clear ion-navicon">
</button>
</ion-nav-buttons>
</ion-nav-bar>
<ion-nav-view name="mainContent"></ion-nav-view>
</ion-pane>
<ion-side-menu side="left">
<header class="bar bar-header bar-dark">
<h1>Home</h1>
</header>
<ion-content class="has-header highlight sidemenu">
<ion-list>
<ion-item nav-clear menu-close ui-sref="app.home">
Home
</ion-item>
</ion-list>
</ion-side-menu>
</ion-side-menus>
離子服務器顯示白色屏幕也沒有錯誤顯示在控制檯。
誰能給我一個想法??? – akashu