当我在命令提示符下输入'ionic serve'时,我想将Registration.html页面设置为我的起始页面。
这是我的app.js代码,index.html& Registration.html
应该做出哪些改变才能取得成果?
app.js:
.config(function($stateProvider, $urlRouterProvider) {
$stateProvider
.state('Registration', {
url: '/Registration',
templateUrl: 'templates/Registration.html'
controller: 'RegistrationController'
})
$urlRouterProvider.otherwise('/Registration');
})
的index.html:
<body ng-app="starter">
<ion-pane>
<ion-header-bar class="bar-stable">
<h1 class="title">Demo</h1>
</ion-header-bar>
<ion-content>
</ion-content>
</ion-pane>
Registration.html:
<ion-view view-title="Registration">
<ion-content class="padding">
<h1>Welcome !</h1>
<h1>Please Sign in To Connect</h1>
<div class="list">
<button class="button ion-social-linkedin button-positive button-block" >Connect using LinkedIn</button>
<button class="button ion-social-google button-positive button-block" >Connect using Google</button>
</div>
</ion-content>
</ion-view>
答案 0 :(得分:1)
在body.html中的body.html之间只需放置<ion-nav-view></ion-nav-view>
删除其他所有内容......
答案 1 :(得分:0)
如果你使用州应用程序,试试这个:
$urlRouterProvider.otherwise('/app/Registration');