0
$scope.logout = function() {
//var auth_token = $cookieStore.get('auth_token');
Auth.delete({
'auth_token': $cookieStore.get('auth_token')
}, function(data){
$scope.isLoggedIn = false;
$cookieStore.remove('auth_token');
});
當這個叫它給了我一個錯誤:AngularJS代碼返回錯誤?
Error: [$resource:badcfg] http://errors.angularjs.org/1.2.27/$resource/badcfg?p0=object&p1=array
z/<@http://ajax.googleapis.com/ajax/libs/angularjs/1.2.27/angular.min.js:6:450
t/</f[d]/q<@http://ajax.googleapis.com/ajax/libs/angularjs/1.2.27/angular-resource.min.js:8:1
De/e/l.promise.then/[email protected]://ajax.googleapis.com/ajax/libs/angularjs/1.2.27/angular.min.js:101:87
De/e/l.promise.then/[email protected]://ajax.googleapis.com/ajax/libs/angularjs/1.2.27/angular.min.js:101:87
De/f/<.then/<@http://ajax.googleapis.com/ajax/libs/angularjs/1.2.27/angular.min.js:102:259
Yd/this.$get</[email protected]://ajax.googleapis.com/ajax/libs/angularjs/1.2.27/angular.min.js:113:28
Yd/this.$get</[email protected]://ajax.googleapis.com/ajax/libs/angularjs/1.2.27/angular.min.js:110:109
Yd/this.$get</[email protected]://ajax.googleapis.com/ajax/libs/angularjs/1.2.27/angular.min.js:113:360
[email protected]://ajax.googleapis.com/ajax/libs/angularjs/1.2.27/angular.min.js:72:452
[email protected]://ajax.googleapis.com/ajax/libs/angularjs/1.2.27/angular.min.js:77:463
ye/</[email protected]://ajax.googleapis.com/ajax/libs/angularjs/1.2.27/angular.min.js:79:24
http://ajax.googleapis.com/ajax/libs/angularjs/1.2.27/angular.min.js
Line 92
http://errors.angularjs.org/1.2.27/$resource/badcfg?p0=object&p1=array。如果您轉到錯誤中提供的網址,則說明問題所在。您的$資源被配置爲返回一個數組,但服務器正在發送一個對象,反之亦然。更改您的資源配置,有一個isArray屬性,您可以相應地設置爲true或false。 –
使用非縮小版角度來了解錯誤細節 – harishr