gpt4 book ai didi

angularjs - ng-view 不适用于 Microsoft Edge

转载 作者:行者123 更新时间:2023-12-04 01:15:32 25 4
gpt4 key购买 nike

我正在 Microsoft Edge 上测试我的应用程序并抛出此错误:

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

在我的索引中:
<body  style="height: 100%">
<div class='main-div' style="height: 100%;" ng-view ng-class="slide">Loading....</div>
</body>

第一种情况: '<application-manage></application-manage>'它工作正常。但是当我点击注销时。它抛出错误:
SyntaxError <div class="main-div ng-scope" style="height: 100%" ng-class="slide" ng-view="">

谢谢大家。问题解决了,这是因为我使用基本身份验证的方式:
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);
});

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

最佳答案

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'**

关于angularjs - ng-view 不适用于 Microsoft Edge,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32392931/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com