ng-view不支持微软Edge

时间:2021-10-03 19:38:04

I am testing my application on Microsoft Edge and it throws this error:

我正在Microsoft Edge上测试我的应用程序,它会抛出以下错误:

    app.config(
        function ($routeProvider) {
      $routeProvider.
          when('/logout', {
              template: '<logout-page></logout-page>'
          })
          .when('/', {
              template: '<application-manage></application-manage>'
          })
});

In my index:

在我的指数:

<body  style="height: 100%">
<div class='main-div' style="height: 100%;" ng-view ng-class="slide">Loading....</div>
</body>

With the first case: '<application-manage></application-manage>' it's working normal. But when I click logout. It throws error:

对于第一种情况:' '它正常工作。但当我点击登出。它抛出错误:

SyntaxError <div class="main-div ng-scope" style="height: 100%" ng-class="slide" ng-view="">

Thanks everyone. The problem is solved, it's because of the way I am using basic authentication:

谢谢每一个人。问题解决了,这是因为我使用基本认证的方式:

jQuery.ajax({
              type: "GET",
              url: logoutURL ,
              async: true,
              username: fakeUser,
              password: fakePassword,
              headers: {"Authorization": "Basic Authorization"}
          }).done(function () {
             console.log("Can not logout Basic Authentication in this browser");
         defer.resolve(true);
            }).fail(function () {
                console.log("You have successfully logged out!");
                defer.resolve(true);
           });

From: http://*.com/questions/233507/how-to-log-out-user-from-web-site-using-basic-authentication

来自:http://*.com/questions/233507/how-to-log-out-user-from-web-site-using-basic-authentication

2 个解决方案

#1


-1  

Try:

   app.config(
        function ($routeProvider) {
      $stateProvider
                .state('/logout', {
url:'/logout',
              template: '<ui-view>'
          })
          .state('/', {
url:'/',
              template: '<ui-view>'
          })
});

You can Also use external html file, in this case use **templateUrl:'your file.html'**

#2


-5  

Suggestion here, can you please provide name to app as below in HTML:

建议如下,请您用HTML给app提供如下名称:

ng-app="XYZManagementApp"

#1


-1  

Try:

   app.config(
        function ($routeProvider) {
      $stateProvider
                .state('/logout', {
url:'/logout',
              template: '<ui-view>'
          })
          .state('/', {
url:'/',
              template: '<ui-view>'
          })
});

You can Also use external html file, in this case use **templateUrl:'your file.html'**

#2


-5  

Suggestion here, can you please provide name to app as below in HTML:

建议如下,请您用HTML给app提供如下名称:

ng-app="XYZManagementApp"