在Ionic AngularJS中设置默认视图
我已经开始学习离子。我想设置一个默认路径到我的home.html,但它不起作用 index.html在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
<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');