0

I am using AngularJS routing, which is changing the template when I select a link. However, for the last page, I have a link that I want to go to another internal HTML page and not load a template view again. How can I do this?

So far I have tried a few options but here is what I have now.

app.config(['$routeProvider', '$locationProvider', function($routeProvider, $locationProvider){

  .when("/page-eight", {
    templateUrl : "views/page-eight.html",
    controller: 'primaryController'
  }) 
  .otherwise({
    templateUrl : "views/start.html"
  });
}]);

The above routing work, but as I have a link in my page-eight.html template as shown below, how can I force it to go to an internal page instead?

<a ng-href="internal-page.html" class="btn-solid">Go to Internal Page</a>

It seems that by clicking on the link above, this is connected to the 'otherwise' part of my route set up. Therefore, this doesn't go to my internal-page.html but loads in my start.html, not what I want.

2
  • 1
    What about adding the internal-page to the routing? Commented Jun 21, 2018 at 14:34
  • Because it is not using, and is different than the template. Commented Jun 21, 2018 at 14:38

1 Answer 1

1

I believe if you add target="_self" it will bypass the router.

Also, your server side route handler needs to serve up the correct "non-SPA" content for that specific page, depending how you have it set up.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.