Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/angularjs/24.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
在Ionic AngularJS中设置默认视图_Angularjs_Ionic Framework - Fatal编程技术网

在Ionic AngularJS中设置默认视图

在Ionic AngularJS中设置默认视图,angularjs,ionic-framework,Angularjs,Ionic Framework,我已经开始学习离子。我想设置一个默认路径到我的home.html,但它不起作用 index.html <ion-header-bar align-title="left" class="bar-positive"> <div class="buttons"> <button class="button icon ion-navicon"></button> </div> <h1

我已经开始学习离子。我想设置一个默认路径到我的home.html,但它不起作用

index.html

<ion-header-bar align-title="left" class="bar-positive">
      <div class="buttons">
        <button class="button icon ion-navicon"></button>
      </div>
      <h1 class="title" style="text-align: center;">Title!</h1>
      <div class="buttons">
        <button class="button icon ion-home"></button>
      </div>
    </ion-header-bar>
    <ion-nav-view></ion-nav-view>
<h1>Hello world!</h1>

帮帮我,我哪里做错了。

我认为你应该更改主页的url

.state('home', {
        url: '/home',
        views: {
          'login': {
            templateUrl: 'templates/home.html',
            controller: 'PlaylistsCtrl'
          }
        }
      })
    // if none of the above states are matched, use this as the fallback
    $urlRouterProvider.otherwise('/home');

尝试
$urlRouterProvider。否则('/home')
.state('home', {
        url: '/home',
        views: {
          'login': {
            templateUrl: 'templates/home.html',
            controller: 'PlaylistsCtrl'
          }
        }
      })
    // if none of the above states are matched, use this as the fallback
    $urlRouterProvider.otherwise('/home');