我测试我对微软Edge应用程序,它抛出这个错误:NG-视图不工作的微软边缘
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
logoutPage指令是什么样的? – Claies
我知道你使用的是常规的$ routeProvider。如果可能的话,我会强烈建议使用ui-router尝试这个功能:https://github.com/angular-ui/ui-router。去年在ng-conf的Angular团队暗示每个人都应该使用ui-router(这是他们将在Angular 2之后建模的)。这可能会阻止您使用ng-view,正如Fabrice所建议的那样,可能会导致您的SyntaxError。 –
@Claies说什么,发布您的注销页面和应用程序管理指令模板 – Beyers