Questions tagged [angularjs-ng-route]

The ngRoute module provides routing and deeplinking services and directives for angular apps.

From Angularjs documentation:

The ngRoute module provides routing and deeplinking services and directives for angular apps.

See $route for an example of configuring and using ngRoute

Resources

328 questions
245
votes
8 answers

How/when to use ng-click to call a route?

Suppose you are using routes: // bootstrap myApp.config(['$routeProvider', '$locationProvider', function ($routeProvider, $locationProvider) { $routeProvider.when('/home', { templateUrl: 'partials/home.html', controller:…
102
votes
5 answers

angularjs 1.6.0 (latest now) routes not working

I was expecting to see this question on Stackoverflow but didn't. Apparently I'm the only one having this problem that seems to me to be very common. I have a basic project I am working on but the routes don't seem to work even though everything…
27
votes
3 answers

Angular 5 - redirect page to homepage on browser refresh

Currently, when I refresh a page from a route like http://localhost:4200/feedback it stays on the same route. But I want the route to redirect to http://localhost:4200 I saw people have asked how to implement the refresh to stay on the same…
simplelenz
  • 877
  • 1
  • 9
  • 22
16
votes
8 answers

Angular - same Url "/" but with different templates based on user's logged in status

I am trying to have two different templates. One that is the landing page for logged out users describing about the business and the other dashboard page for if a user is logged in. I read on this other stack on how to do this with UI-router. I…
Austin Perez
  • 587
  • 7
  • 27
15
votes
1 answer

Angular routes contain #! in the url instead of #

Recently I have noticed that when using ngRoute module in an AngularJS app, the route contains #! in the URL, which was earlier just the #. For example, www.webiste.com/#/login becomes www.website.com/#!/login I have to enable the html5Mode and also…
13
votes
3 answers

How to change page title in Angular using $routeProvider

I found several similar questions, however none of the answers helped. They all seem to involve some type of $location dependencies that I'm unable to get injected right. My code below: (function() { // App dependencies var app =…
Leon Gaban
  • 36,509
  • 115
  • 332
  • 529
11
votes
1 answer

How to host an AngularJS app in Heroku using Node.js WITHOUT using yeoman?

I'm trying to push a Hello World build with AngularJS into Heroku using Node.js. BUT with multiple views(partials). I first deployed a Hello World without using ngRoute, meaning: without partials. That was fine and smooth. Then, I tried to push 2…
pgarciacamou
  • 1,602
  • 22
  • 40
8
votes
1 answer

$location changes the ? parameter delimiter

I wan't to open the following url from my controller /plant/needs/temperatures?open=temperatures, where the parameter open=temperatures is there to ask the page to open the related popup with the code as follows: $scope.openPageUrl = function (url)…
Stéphane de Luca
  • 12,745
  • 9
  • 57
  • 95
7
votes
1 answer

Angular $routeProvider http://localhost/thisapp/ == ok, http://localhost/thisapp/#/ == error. Why?

I'm having (albeit minor) issues with $routeProvider. http://localhost/thisapp/ works fine, and redirects to the .otherwise() perfectly. But it seems that once the app is loaded and lands on the "home" url (http://localhost/thisapp/#/) Then it…
MaxRocket
  • 920
  • 1
  • 12
  • 26
5
votes
3 answers

AngularJS routing 404 error with HTML5 mode

I just got started with angular js , i tried routing and worked pretty well .The problem is when i refresh the page it is showing 404 error since it is checking in my actual directory rather than checking in routes. here is the complete…
5
votes
4 answers

Login Page without Index.html Design - ngRoute (AngularJS)

I'm using ngRoute to do the routing of my AngularJS application (myApp) but I have a problem: I don't know how to NOT APPLY my index.html design (with all my sidebars) to my login.html page, which seems to be applied by default if it is defined as a…
Ariana
  • 499
  • 1
  • 7
  • 13
5
votes
0 answers

How to integrate revealjs into angularjs

I need to load/start revealjs slides via angularjs route provider, following is the code. It works however revealjs slide size is abnormally very small, any clue why ? 1) index.html
FirstNameSurName
  • 199
  • 1
  • 1
  • 7
5
votes
1 answer

$routeChangeStart getting called multiple times in IE8

We are supporting IE8 browser for our application. Recently we are upgraded angular version from 1.0.8 to 1.2.16 application with newer version works in all browsers however we seen the issue with ngRoute in IE8. It broadcasts the…
user3249448
  • 1,369
  • 2
  • 14
  • 34
4
votes
3 answers

how to keep header of content div fixed?

I have a web page built in angularjs .
Here the header and footer is always fixed, but in content section…
shreyansh
  • 1,637
  • 4
  • 26
  • 46
4
votes
1 answer

Using Angular route in webapi application

I'm not sure how can I implement proper Angular routing in web api application. I'm able to open the pages using this approach: http://localhost:52876/HTML/app/borrower.html The Angular controller loads fine and all functionality is there from the…
Laziale
  • 7,965
  • 46
  • 146
  • 262
1
2 3
21 22