How to exit a SPA (Single Page Application) from AngularJs

0

I have following code:

var app = angular.module("appSystem", ['ngRoute']);

app.config(function ($routeProvider, $locationProvider) {
    $routeProvider
    .when("/teste", {templateUrl: './view/teste.html', controller: 'testeController'})
    .when("/about", {templateUrl: './view/sobre.html', controller: 'sobreController'})
    .otherwise({redirectTo: "/app"});

    $locationProvider.html5Mode(true);
});

Let's imagine the following situation

The site has static pages and has links in its navigation bar for them, suppose we have Home , Login and of these static pages we have one called Application , where it is a SPA that I use Angular .

  • These two pages that are in the app configuration are my hypothetical views .
  • The base url for SPA set in html is <base href="/aplicacao" />

The rest is all running and is not the case here.

How do I get out of the SPA?

That is, since I had my navigation bar that made requests to the server to change pages, with this configuration of routes everything changes. How do I set within the Angular that the routes established for the links in the navigation bar (and also in some footer) are met outside the SPA?

    
asked by anonymous 03.11.2016 / 21:44

1 answer

2

In SPA, you can by a button to exit or in some function to return to some url of the home, you can use window.location.assign("http://exemplo.com.br/home"); of javascript.

    
03.11.2016 / 22:05