AngularJS $ routeProvider, go to default navigation by default

Thus, not 100% of my site "runs on AngularJS", some of them are just plain static HTML, like a landing page or content-oriented material, which for simple reasons is plain HTML.

The only way I can get the link to navigate normally is as follows:

  $routeProvider
    .when('/plans', {templateUrl: '<%= asset_path('ng/views/start.html') %>'})
    # Catch all
    .otherwise({ redirectTo: (p,loc) -> window.location = loc })

It seems that the trick should be simpler, as I could do .otherwise(false), and it will just move normally. The same goes for `.when ('/ something' /, false), but I don’t see anything in documents that suggest that this is possible.

Does anyone know how best to do this?

Edit 1:

One of the solutions I found is to use target='_self'in a link.

, -, " url" , . . , , , .

+5
1

URL- hashbang (, #/plans), , html5 history api ($ locationProvider.html5 (true)), ( [href ] ) .

:

https://github.com/angular/angular.js/blob/4df45b20d460239a0f5001fb0dd59f95e2d0e80d/src/ng/location.js#L560

target="_self" a. , html5 (history pushState).

+3

All Articles