【发布时间】:2016-04-29 15:18:25
【问题描述】:
我有点困惑,我正在按照本教程尝试让 autheictaion 工作。 https://devdactic.com/user-auth-angularjs-ionic/
我被困在第一阶段
这是我的 app.js
// create main module, adding dependencies for ionic, angular router, angular mock and apps own modules
var jailbreak = angular.module('jailbreak', ['ionic', 'ui.router', 'map', 'chat', 'constant'])
jailbreak.run(function(AUTH_EVENTS) {
document.getElementById('debug').innerHTML = JSON.stringify(AUTH_EVENTS);
})
那么这是我的常量.js
angular
.module('constant', [])
.constant('AUTH_EVENTS', {
notAuthenticated: 'auth-not-authenticated',
notAuthorized: 'auth-not-authorized'
})
.constant('USER_ROLES', {
admin: 'admin_role',
public: 'public_role'
});
【问题讨论】:
-
你遇到了什么错误?
-
当我试图将 AUTH_EVENTS 显示为空时
标签: javascript angularjs local-storage constants