我能够使firebaseSimpleLogin工作并将当前用户存储在rootScope中.当我转到另一个页面并返回到feed页面时,所有内容都会加载,但是当我刷新$ rootScope.currentUser时为null.其他人遇到过这个问题吗?
我的app.run函数中有这段代码:
$rootScope.$on('$firebaseSimpleLogin:login',function(e, auth){
$rootScope.currentUser = User.find(auth.id);
});
Run Code Online (Sandbox Code Playgroud)
这是我的FeedCtrl试图加载用户的帖子
app.controller('FeedCtrl',['$scope', '$rootScope','User','Auth','Post',function($scope, $rootScope,User,Auth,Post){
populateFeed();
console.log($rootScope.currentUser);
$scope.logout = function(){
Auth.logout();
};
$scope.savePost = function(){
Post.create($scope.post).then(function(post){
$scope.post.text = "";
});
};
function populateFeed(){
$scope.posts = {};
angular.forEach($rootScope.currentUser.posts,function(id){
$scope.posts[id] = Post.find(id);
});
}
}]);
Run Code Online (Sandbox Code Playgroud)
我的主要应用模块
var app = angular.module('myapp',['ui.router','firebase']);
app.config(function($stateProvider, $urlRouterProvider){
$stateProvider
.state('/',{
url: '/',
controller: 'MainCtrl',
templateUrl: 'views/index.html'
})
.state('feed',{
url: '/feed',
controller: 'FeedCtrl',
templateUrl: 'views/feed.html',
authenticate: true
})
.state('login',{
url: '/login',
controller: 'LoginCtrl',
templateUrl: 'views/login.html'
})
.state('signup',{
url: '/signup',
controller: 'LoginCtrl', …Run Code Online (Sandbox Code Playgroud) 有没有人有这个问题,他们得到一个文件无法写入磁盘.ExpressionEngine v2.9.2上的错误.我注意到我只有2MB及以上的文件出现此问题,而在其他帖子中我已经关闭了XSS过滤而没有任何帮助.如果它意味着我在两个负载均衡的EC2实例上运行EE.使用OpsWorks处理部署.我还增加了文件上传大小和帖子大小,以及ELB连接设置.
所以我正在使用WordPress网站,我需要创建一个自定义帖子类型.我有功能设置来使用WordPress初始化它
add_action( 'init', 'init_staff' );
function init_staff(){
register_post_type('staff_members',array(
"labels" => array(
"name" => "Staff Members",
"singular_name" => "Staff Member",
"menu_name" => "Staff Members",
"add_new" => "Add New",
"add_new_item" => "Add New Staff Member",
"edit" => "Edit",
"edit_item" => "Edit Staff Member",
"new_item" => "New Staff Member",
"view" => "View",
"view_item" => "View Staff Member",
"search_items" => "Search Staff Members",
"not_found" => "No Staff Member Found",
"not_found_in_trash" => "Staff Member Not Found in Trash"
),
"public" => true,
"supports" => array('title','editor','thumbnail'), …Run Code Online (Sandbox Code Playgroud)