Search Posts

Category: angular-routing

ng-view causes page to crash

Trying to replicate a simple routing example w3schools, but it keeps crashing with “RangeError: Maximum call stack size exceeded” in the console, when accessing index.html. I tried to add/remove parts of the code to isolate the problem, and the crash seems to happen at <div ng-view></div>. Why is that? The changes I made from the original example are not that drastic. Here is the code index.html <html xmlns=””> <head> <meta http-equiv=”Content-Type” content=”text/html; charset=utf-8″ /> <script […]

Routing issue with angular directives

I’m trying to setup one of my first angular projects and am having trouble getting to grips with the routing. On page load I see the initial template that has been set by the preferencesDirective, which is great. When I click the “Change Template” button I want it to change to another template but nothing happens. If I set the template url’s in the $routeProvider to something invalid then I see a 404 error in […]

Angular rerouting to home page doesn’t work?

Here is my error: core.es5.js:1020 ERROR Error: Uncaught (in promise): Error: Cannot match any routes. URL Segment: ‘home’ This is the code from the view.html: <div class=”container”> This is the main app; <a routerLink=”second”>Click to go to second</a> <a routerLink=”third”>Click to go to third</a> <a routerLink=”home”>Go to Home</a> <router-outlet></router-outlet> </div> And this is my array of objects which includes the path to the home and other paths. The path to the home is correct, hence […]