Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- .state('futureunused', {
- url: '/future/unused',
- views: {
- 'header': {
- templateUrl: '/app/views/common/_header.html',
- controller: 'headerController'
- },
- 'content': {
- templateUrl: '/app/views/futurecontent/futureunused.html',
- controller: 'futureController'
- },
- 'footer': {
- templateUrl: '/app/views/common/_footer.html',
- controller: 'futureController'
- }
- },
- resolve: {
- authenticated: function ($q, $location, $auth, $http) {
- $http.get("http://1.1.1.1:1337/project/active").success(function(response) {
- var activeProjectPath = response.activeProjectKebab;
- console.log(activeProjectPath);
- });
- var deferred = $q.defer();
- if (!$auth.isAuthenticated()) {
- $location.path('/login');
- } else if(activeProjectPath) {
- $location.path('/forehead-website/future/unused');
- } else {
- return deferred.resolve();
- }
- return deferred.promise;
- }
- }
- })
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement