2016-04-29 45 views
0

做與離子的教程,我似乎無法呈現一個基本的網頁...只是空白。查看未dispaying模板離子

這是我家的模板home.html的

<ion-nav-bar class="bar-balanced"> 
<h1 class="title">Elite Schedule</h1> 

<ion-tab title="My Teams" icon="ion-star" ui-sref="home.myteams"> 
    <ion-nav-view name="tab-myteams"></ion-nav-view> 
</ion-tab> 

這是主要的索引頁

<!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"> 
--> 
<script src="js/platformOverrides.js"></script> 

<!-- 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> 
<base href="/" /> 
</head> 
<body ng-app="eliteApp"> 
<ion-ng-view></ion-ng-view> 
</body> 
</html> 

這是我的app.js控制器

(function() { 
"use strict" 
    var eiliteApp = angular.module("eliteApp", ["ionic"])//injecting ionic as a dependancy 

.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) { 
      // org.apache.cordova.statusbar required 
      StatusBar.styleDefault(); 
     } 
    }); 
}) 

eiliteApp.config(["$stateProvider", "$urlRouterProvider", "$locationProvider", function ($stateProvider, $urlRouterProvider, $locationProvider) { 
     $urlRouterProvider.otherwise("/");//default url 
     $stateProvider.state("home", { 
      abstract: true, 
      url: "/", 
      templateUrl: "app/home/home.html" 
     }) 
     $locationProvider.html5Mode(true); 
    }] 
); 

})();

我缺少什麼?

+0

替換

<ion-ng-view></ion-ng-view> 

更換標籤''到'<離子NAV-視圖>' –

回答

0

你不指定任何地方控制。您可以在app.config中定義路徑,也可以在ng-controller =「controllerName」的模板中執行此操作,但如果這是您的所有代碼,那麼您還沒有創建控制器。目前還不清楚你期望看到什麼。

0

嘗試用

<ion-nav-view></ion-nav-view>