Advertisement
Guest User

Untitled

a guest
Mar 24th, 2015
100
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.29 KB | None | 0 0
  1. .state('futureunused', {
  2. url: '/future/unused',
  3. views: {
  4. 'header': {
  5. templateUrl: '/app/views/common/_header.html',
  6. controller: 'headerController'
  7. },
  8. 'content': {
  9. templateUrl: '/app/views/futurecontent/futureunused.html',
  10. controller: 'futureController'
  11. },
  12. 'footer': {
  13. templateUrl: '/app/views/common/_footer.html',
  14. controller: 'futureController'
  15. }
  16. },
  17. resolve: {
  18. authenticated: function ($q, $location, $auth, $http) {
  19. $http.get("http://1.1.1.1:1337/project/active").success(function(response) {
  20. var activeProjectPath = response.activeProjectKebab;
  21. console.log(activeProjectPath);
  22. });
  23. var deferred = $q.defer();
  24.  
  25. if (!$auth.isAuthenticated()) {
  26. $location.path('/login');
  27. } else if(activeProjectPath) {
  28. $location.path('/forehead-website/future/unused');
  29. } else {
  30. return deferred.resolve();
  31. }
  32.  
  33. return deferred.promise;
  34. }
  35. }
  36. })
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement