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 us imagine the following situation
The site has static pages and has links in its navigation bar to them, suppose we have Home, Login and Register, beyond these static pages we have a, call Applying, where is a spa that I use the Angular.
- These two pages that are in the configuration of the app are my views hypothetical.
- The base url for the SPA defined in html is
<base href="/aplicacao" />
The rest is all running and does not come to the case here.
How 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?
One output would be to implement iframes. Another, Use <a href='[link]' target="_Blank">`.
– OnoSendai
You are using the Html5 route mode,
$locationProvider.html5Mode(true)
? https://docs.angularjs.org/guide/$Location– Giovane