具有不同视图的相同链接

时间:2016-03-18 04:04:24

标签: javascript html angularjs

我正在关联登录页面,但问题是,如果链接是“admin_1_angularjs / login.html”,则该网页与“admin_1_angularjs /#/ login.html”不同

MetronicApp.config(['$stateProvider', '$urlRouterProvider', function($stateProvider, $urlRouterProvider) {
// Redirect any unmatched url
$urlRouterProvider.otherwise("/login.html");
app.version = '1454574448';

$stateProvider.state('login', {
    url: "/login.html",
    templateUrl: 'login.html?_=' + app.version,
    controller: 'login'
    })

我做错了什么? 这是我的HTML代码 如果有人能够检测到错误,请提前感谢<谢谢。

<!-- END HEAD -->
<body class="login" ng-controller="login">

    <!-- BEGIN LOGO -->
    <div class="logo">
        <a href="login.html">
            <img src="../assets/pages/img/logo-big.png" alt=""> </a>
    </div>
    <!-- END LOGO -->
    <!-- BEGIN LOGIN -->
    <div class="content">
        <!-- BEGIN LOGIN FORM -->
        <!-- BEGIN LOGIN FORM -->
        <form name="loginForm" ng-submit="(loginForm.username.$valid && loginForm.password.$valid) ? login() : '';">
                <div class="alert alert-danger" ng-if="hasError">
                    <button type="button" class="close" aria-hidden="true" ng-click="setError(false);">&times;</button>
                    <strong>Error!</strong> {{errorMessage}}
                </div>
                  <h3 class="form-title">Login to your account</h3>
                    <div class="alert alert-danger display-hide">
                      <button class="close" data-close="alert"></button>
                    </div>
                        <div class="form-group has-feedback" ng-class="loginForm.username.$valid ? 'has-success' : 'has-error';">
                            <label class="control-label" for="username">Username</label>
                            <input type="text" class="form-control" id="username" name="username"
                                   ng-model="input.username" required>
                            <span class="glyphicon form-control-feedback"
                                  ng-class="loginForm.username.$valid ? 'glyphicon-ok' : 'glyphicon-remove';"></span>
                        </div>
                        <div class="form-group has-feedback" ng-class="loginForm.password.$valid ? 'has-success' : 'has-error';">
                            <label class="control-label" for="password">Password</label>
                            <input type="password" class="form-control" id="password" name="password"
                                   ng-model="input.password" required ng-minlength="5">
                            <span class="glyphicon glyphicon-asterisk form-control-feedback"
                                  ng-class="loginForm.password.$valid ? 'glyphicon-ok' : 'glyphicon-remove';"></span>
                        </div>
                        <div ng-switch on="isLoading">
                            <div ng-switch-when="true">
                                <button type="button" class="btn btn-primary btn-block disabled">Logging in ...</button>
                            </div>
                            <div ng-switch-when="false">
                                <button type="submit" class="btn btn-primary btn-block">Login</button>
                            </div>
                        </div>
                    </div>
                </div>
            </form>

        <!-- END REGISTRATION FORM -->
    </div>
    <!-- END LOGIN -->

0 个答案:

没有答案