angular-rails-templates
angular-rails-templates copied to clipboard
I got empty page in production mode
Hi, I deployed my application to aws ec2 via elastic beanstalk(eb), Then I tried to enter to my application but I got blank page and no error on javascript console, no error log in server.
On web inspector don't have any content inside ui-view
I'm not sure is related with angular-rails-temples but only I thought right now my application use this lib to serve view. Anyone help me please.
Thank you
Update
I found answer https://github.com/pitr/angular-rails-templates/issues/97 that tell to use 'sprockets', I just try and still not working for me
I found something in route and considering below
'use strict'
alert('route'); <----- is working
angular.module('core').config(['$stateProvider', '$urlRouterProvider',
function ($stateProvider, $urlRouterProvider) {
// Redirect to 404 when route not found
$urlRouterProvider.otherwise(function ($injector, $location) {
$injector.get('$state').transitionTo('not-found', null, {
location: false
});
});
alert('inside route') <--- is working
// Home state routing
$stateProvider
.state('home', {
url: '/',
abstract: true,
templateUrl: 'players/layout/home.client.view.html',
controllerAs: 'vm',
controller: 'MasterController',
resolve: {
user_noti: function($http, $stateParams,jwtHelper, $window) {
alert('insde part') <--- not woking
if($window.user) {
return $http.get('/api/v1/notifications');
} else {
return [];
}
},
user_unconfrim_ticket: function($http, $stateParams,jwtHelper, $window){
if($window.user) {
return $http.get('/api/v1/tickets/unconfrim');
} else {
return [];
}
}
}
})
.state('home.index', {
url: '',
controllerAs: 'vm',
controller: 'HomeController',
data: {
ignoreState: true
},
templateUrl: 'players/home.client.view.html',
resolve: {
reward_data: function($http, $stateParams) {
return $http.get('/api/v1/rewards');
},
answers_data: function($http, $stateParams){
return $http.get('/api/v1/answers/current');
}
}
})
.state('home.game', {
url: 'game',
controller: 'GameController',
controllerAs: 'vm',
data: {
roles: ['player']
},
templateUrl: 'players/game/game.client.view.html'
});
}
]);
And I put alert() in top of controller file is working and inside controller function is not working, I thought is not working since route can't detect the path
Any Sugesstion?
Update: I found actually problem, A real problem. if some state have resolve function it will be freeze ui. I don't know why because I never met before. I working with resolve many time only error form server will make resolve and ui will freeze. I ran "rails s -e production" is work normal but on real server not working