我是离子框架的初学者。我已将模板加载到索引文件中,但无法从登录屏幕移动到注册屏幕。请看看我的代码,让我知道有什么问题。
索引.html
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>IonicApp</title>
</head>
<body>
<html ng-app="ionicApp">
<head>
<meta charset="utf-8">
<meta name="viewport" content="initial-scale=1, maximum-scale=1, user-scalable=no, width=device-width">
<title>IonicApp</title>
<link href="lib/ionic/css/ionic.css" rel="stylesheet">
<script src="lib/ionic/js/ionic.bundle.js"></script>
<link href="css/font-awesome.css" rel="stylesheet">
<link href="css/style.css" rel="stylesheet">
</head>
<body>
<ion-nav-bar>
<ion-nav-back-button class="button-icon ion-arrow-left-c">
</ion-nav-back-button>
</ion-nav-bar>
<ion-nav-view></ion-nav-view>
</body>
</html>
<script src="js/app.js"></script>
</body>
</html>
登录.html
<ion-view view-title="Login" class="login" hide-nav-bar="true">
<ion-content scroll="false">
<div class="content">
<div class="row topgap">
<div class="col-80 col-offset-10">
<div class="fixWidthContainer">
<h2 class="text-center">Welcome to App</h2>
<input type="email" placeholder="Email" />
<input type="password" placeholder="Password" />
<br />
<button class="button button-full LoginButton">Login</button>
<button class="button button-full LoginButton facebook">Sign up using Facebook</button>
<br />
<button class="button button-full LoginButton forgot">Forgot Password?</button>
<br />
<a class="button button-full LoginButton forgot" ng-href="templates/signup.html">Sign Up</a>
</div>
</div>
</div>
</div>
</ion-content>
</ion-view>
注册.html
<ion-view view-title="Sign Up" class="login" hide-nav-bar="true">
<ion-content class="has-footer" scroll="false">
<div class="row topgap">
<div class="col-80 col-offset-10">
<div class="fixWidthContainer">
<h2 class="text-center">Welcome to App</h2>
<input type="text" placeholder="Full Name" />
<input type="email" placeholder="Email" />
<input type="password" placeholder="Password" />
<br />
<button class="button button-full LoginButton">Sign up</button>
<button class="button button-full LoginButton facebook">Sign up using Facebook</button>
</div>
</div>
</div>
</ion-content>
</ion-view>
应用程序.js
angular.module('ionicApp', ['ionic'])
.config(function($stateProvider, $urlRouterProvider) {
$stateProvider
.state('login', {
url: '/login',
templateUrl: 'templates/login.html',
//controller: 'loginControl'
})
.state('signup', {
url: '/signup',
templateUrl: 'templates/signup.html',
//controller: 'signupControl'
})
$urlRouterProvider.otherwise('/login');
}) // Main Controller Ends
如果我从控制器中删除评论,页面就会受到干扰。