Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/77.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 无法在Url中附加html页面名称_Javascript_Html_Angularjs - Fatal编程技术网

Javascript 无法在Url中附加html页面名称

Javascript 无法在Url中附加html页面名称,javascript,html,angularjs,Javascript,Html,Angularjs,这是我的两个html文件indexAf.html和HomeAF.html index.html <!DOCTYPE html> <html ng-app="hlfabric"> <head> <meta charset="ISO-8859-1"> <title>AF Login Page</title> <link rel="stylesheet" href="styleAf.css" type="te

这是我的两个html文件indexAf.html和HomeAF.html

index.html

<!DOCTYPE html>
<html ng-app="hlfabric">
<head>
<meta charset="ISO-8859-1">
<title>AF Login Page</title>
        <link rel="stylesheet" href="styleAf.css" type="text/css" />
        <script src="lib/angular.min.js"></script>
        <script src="lib/angular-route.min.js"></script>
        <script src="appHLVL.js"></script>
</head>
<body>
    <body ng-controller="AppCtrlAf">
        <div ng-include="template.url"></div>
    </body>
</body>
</html>

从indexAf.html导航到HomeAF.html时,页面正在导航,但url没有改变(没有附加HomeAF.html)而不是indexAf.html。我想在从一个页面导航到另一个页面时更改url。

您在哪里更改url?发布您的配置文件我正在使用ng include在js文件中更改您仅使用ng include更改模板,而不是url。如果您想在angularjs中实现路由,请检查您在哪里更改url?发布您的配置文件我正在使用ng include在js文件中更改您仅使用ng include更改模板,而不是url。如果您想在angularjs中实现路由,请检查
<!DOCTYPE html>
<html ng-app="hlfabric">
<head>
<meta charset="ISO-8859-1">
<title>AF Login Page</title>
        <link rel="stylesheet" href="styleAf.css" type="text/css" />
        <script src="lib/angular.min.js"></script>
        <script src="lib/angular-route.min.js"></script>
        <script src="appHLVL.js"></script>
</head>
<body>

</body>
</html>
var appHlVl = angular.module('hlfabric', [ 'ngRoute' ]);

appHlVl.controller('AppCtrlAf', function($scope, $rootScope) {
    $scope.templates = [ {
        url : 'LoginAf.html'
    }, {
        url : 'HomeAF.html'
    } ];
    $scope.template = $scope.templates[0];
    $scope.login = function(username, password) {
        if (username === 'AFBlockchain' && password === 'Value12') {
            //authentication.isAuthenticated = true;
            $scope.template = $scope.templates[1];
            $scope.user = username;
        }else{
            $scope.loginError = "Invalid username/password combination";
        }

        ;
    };

});