AngularJS – Acess login page outside onepage application


Its possible to access a login page, outside the structure of single page application? I have this code:

$routeProvider.when('/login', {
    templateUrl: 'partials/login.html',
    controller: 'LoginController'

$routeProvider.when('/dashboard', {
    templateUrl: 'partials/dashboard.html',
    controller: 'DashboardController'

Dashboard is inside the structure of single page application, using the template of my index.html, but my login page should be a external page, that not use the index.html as a template…

is that possible using ngRoute?


The login page should be external as you said, so we have to put it outside of main app, for that we just have:

  1. login app
  2. main app

benefits of make it external app are:

  1. the login not related to your main app it’s just for authentication
  2. the login app not include a lot of states max 2 state it’s just login form or forget password
  3. once users use login app to sign into your main app not more

Answered By – Maher

Answer Checked By – Cary Denson (AngularFixing Admin)

Leave a Reply

Your email address will not be published.