3
我試圖在我的應用程序中對大多數路由的用戶進行身份驗證。AngularJS用解析驗證多個路由
有沒有辦法在全球所有路線上做到這一點?所以我不需要有以下內容:
resolve : {
//This function is injected with the AuthService where you'll put your authentication logic
'auth' : function(AuthService){
return AuthService.authenticate();
}
}
對每個$routeProvider.when()
調用。
這[HTTP驗證攔截模塊(https://github.com/witoldsz/angular-http-auth)可以,如果它不幫偶完全適合你的需要。 – Gloopy
謝謝。這實際上是一個非常有用的方法...... – AndrewMcLagan