Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

I got empty page in production mode #155

Open
NSLog0 opened this issue Jun 7, 2017 · 3 comments
Open

I got empty page in production mode #155

NSLog0 opened this issue Jun 7, 2017 · 3 comments

Comments

@NSLog0
Copy link

NSLog0 commented Jun 7, 2017

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
screen shot 2560-06-08 at 1 30 20 am

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

@NSLog0
Copy link
Author

NSLog0 commented Jun 7, 2017

Update

I found answer #97 that tell to use 'sprockets', I just try and still not working for me

@NSLog0
Copy link
Author

NSLog0 commented Jun 10, 2017

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?

@NSLog0
Copy link
Author

NSLog0 commented Jun 10, 2017

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

@NSLog0 NSLog0 closed this as completed Jun 10, 2017
@NSLog0 NSLog0 reopened this Jun 10, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant