3
var cufe = angular.module('cufeApp', ['ngRoute', 'cufeAppCont'])
    .config(function ($routeProvider) {
        $routeProvider
            .when('/admin', {
                templateUrl: "templates/admin.html"
            })
            .when('/login', {
                templateUrl: "templates/login.html",
                abstract: true,
                controller: "LoginCtrl"
            })
            .when('/qamember', {
                templateUrl: "templates/qamember.html"
                abstract: true
            })
            .otherwise('/login')
    });

In my browser I can direct myself automatically to any of these routes so can I disable them such that any routing like index.html#/admin will be redirected to login unless it's done in a JS script function?

In other words, disable users from seeing pages that aren't intended to them?

Shashank Agrawal
  • 23,503
  • 10
  • 80
  • 110
JenuRudan
  • 516
  • 1
  • 11
  • 28
  • 3
    That post may help you: http://stackoverflow.com/questions/20969835/angularjs-login-and-authentication-in-each-route-and-controller#answer-20971528 – rckd Dec 25 '15 at 10:24

0 Answers0