我有这个.cshtml页面登录
<main id="login" ng-controller="loginCtrl">
<div id="page" class="full-screen min-height">
<div id="page-inner">
<div id="login-page-content" class="min-height-inner container-padding">
<div class="container center text-center">
<h1>
<label>Login</label>
</h1>
<div id="login-form">
<div>
<input type="email" id="Username" placeholder="UserName/Email" class="login-input" required="required" />
</div>
<div>
<input type="password" id="Username" placeholder="Password" class="login-input" required="required" />
</div>
<div>
</div>
<div class="cf">
<input type="submit" value="Login" class="login-submit" ng-click="clicked()"/>
</div>
</div>
<a href="#!/forgotPassword"> Forgot Details ? </a>
</div>
</div>
</div>
</div>
这是我的controller.js
angular.module('userManagement')
.controller('loginCtrl', ['$scope', '$http','$window', function ($scope, $http,$window) {
$scope.clicked = function () {
window.location = '#/join';
}
}
]);
以及我的app.js
$routeProvider.caseInsensitiveMatch = true;
$ routeProvider.when('/ login',{ templateUrl:'帐户/登录', 控制器:'loginCtrl' }); 我希望能够在单击按钮时转到另一个页面,vallidations现在并不重要我只想在按下按钮时按钮转到页面,上面的代码我需要
答案 0 :(得分:1)
您应该使用角度路线系统或ui.router:
ngRoute和位置
$location.path( "#/join" );
ui.router
$state.go(path_to_join_state);