我正在使用Asp.Net Core中的角度路由库来允许客户端路由 . 但是当我点击链接浏览到 editor 视图时,我得到以下额外的 %2F ,它不是路由提供者中的有效路由:

http://localhost:57916/App/trips#!/#%2Feditor

而不是预期的路线将起作用:

http://localhost:57916/App/trips#!/editor

我确实查看了此路由的routeProvider配置,并看到.when检查中没有额外的正斜杠 . 此外,通过Bower安装angular-route并匹配我当前的角度版本 1.6.1

$routeProvider.when("/editor",

Question:

任何人都可以解释为什么在路由中添加额外的正斜杠编码?

链接到编辑器视图的按钮:

<td><a href="#/editor" class="btn btn-sm btn-primary">Manage</a></td>

这是编辑器路由的$ routeProvider:

$routeProvider.when("/editor", {
        controller: "tripEditorController",
        controllerAs: "vm",
        templateUrl: "/views/tripEditorView.html"
    });

以及包含路由的完整app-trips.js文件 . 第一个路由适用于tripsView.html文件:

//app-trips.js
(function () {

    "use strict";


    //Creating the module
    angular.module("app-trips", ["simpleControls", "ngRoute"])
    .config(function ($routeProvider) {

        $routeProvider.when("/", {
            controller: "tripsController",
            controllerAs: "vm",
            templateUrl: "/views/tripsView.html"
        });

        $routeProvider.when("/editor", {
            controller: "tripEditorController",
            controllerAs: "vm",
            templateUrl: "/views/tripEditorView.html"
        });

        $routeProvider.otherwise({ redirectTo: "/" });
    });

})();