Want more features on Pastebin? Sign Up, it's FREE!
Guest

Untitled

By: zishe on Oct 14th, 2013  |  syntax: JavaScript  |  size: 0.91 KB  |  views: 31  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. 'use strict';
  2.  
  3. angular.module('BookReader', ['ngRoute', 'home', 'main', 'exercises', 'books', 'auth']).config([
  4.   '$routeProvider', '$httpProvider', '$locationProvider', 'session', function($routeProvider, $httpProvider, $locationProvider, session) {
  5.     var isAuth;
  6.     return $routeProvider.when('/', {
  7.       templateUrl: 'assets/tour.html',
  8.       controller: 'MainCtrl',
  9.       resolved: {
  10.           isAuth: session.isAuthenticated()
  11.       }
  12.     }).when('/home', {
  13.       templateUrl: 'assets/main.html',
  14.       controller: 'HomeCtrl'
  15.     }).when('/books', {
  16.       templateUrl: 'assets/books.html',
  17.       controller: 'BooksCtrl'
  18.     }).when('/exercises', {
  19.       templateUrl: 'assets/exercises.html',
  20.       controller: 'ExercisesCtrl'
  21.     }).otherwise({
  22.       redirectTo: '/'
  23.     });
  24.   }
  25. ]).run([
  26.   'session', function(session) {
  27.     console.log("check");
  28.     return session.requestCurrentUser();
  29.   }
  30. ]);
clone this paste RAW Paste Data