小编Luc*_*ahn的帖子

离子:路由给出一个空白页面

我刚刚开始学习角度和ioninc来构建一个应用程序.

我刚刚启动了一个包含ionic的新应用程序,并从json文件中创建了一个项目列表.这很完美,但是因为即时跳转到路由我只看到一个空白页面,我不会弄错.

这是我的index.html:

<!DOCTYPE html>
<html >
    <head>
        <meta charset="utf-8">
        <title>Spätifinder</title>
        <meta name="viewport" content="initial-scale=1, maximum-scale=1, user-scalable=no, width=device-width">
        <link rel="stylesheet" href="css/ionic.css">
        <script src="angular.min.js"></script>
    <script src="js/ionic.bundle.js"></script>
    <script src="app.js"></script>
    </head>
    <body ng-app="spaetifinder">
        <ion-header-bar type="bar-positive" 
             animation="nav-title-slide-ios7" 
             back-button-type="button-icon" 
             back-button-icon="ion-ios7-arrow-back"></ion-header-bar>

    <ion-nav-bar class="bar-energized nav-title-slide-ios7">
  </ion-nav-bar>
  <ion-nav-view></ion-nav-view>
    </body>
</html>
Run Code Online (Sandbox Code Playgroud)

这是ma app.js文件:

var app = angular.module('spaetifinder', ['ionic']);

app.config(function ($stateProvider, $urlRouterProvider) {

        // Ionic uses AngularUI Router which uses the concept of states
        // Learn more here: https://github.com/angular-ui/ui-router
        // Set up the various states which the app can be in. …
Run Code Online (Sandbox Code Playgroud)

angularjs angular-ui-router ionic-framework

8
推荐指数
1
解决办法
1万
查看次数