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
1
vote
1 answer

AngularJS $locationChangeStart Event Cancelling Route Navigations

Can Someone please help me out understand how to use the $locationChangeStart Event? Im making aa function that if a user clicks the browser back button without saving the data on the form in that specific page, a modal popup will show saying that…
bleyk
  • 799
  • 3
  • 14
  • 41
1
vote
1 answer

Can I set a parameter using ngRoute?

I am making an app that shows a list of items, and that list can then be refined by multiple filters. If I were to fetch a list of those options from the URL string, then that would allow visitors to share (or bookmark) a link that takes you to a…
Digital Ninja
  • 3,415
  • 5
  • 26
  • 51
1
vote
2 answers

$routeProvider config route throwing 'Uncaught Error: [ng:areq] Argument 'fn' is not a function, got string'

I'm writing routing logic using ngRoute of angular JS. The following is my code. index.js (function() { 'use strict'; function config($routeProvider, $httpProvider, cfpLoadingBarProvider, $tooltipProvider) { …
Anvesh Checka
  • 3,787
  • 2
  • 21
  • 28
1
vote
0 answers

AngularJS - Navigating inside a directive/component

I have a component (directive) which should be used as a stand alone component by other applications (bower component, for example). I want to add navigation inside my directive (using ngRoute or ui-router) - but this could conflict with the host…
1
vote
2 answers

Simple Angular SPA in ASP .NET 5 - getting blank page on startup

I'm attempting to set up a very simple Angular single-page-application in ASP .NET 5. I've begun with an empty project - the only angular dependency at the moment is ngRoute. The problem: When I run the project, I get a blank page in my browser -…
1
vote
1 answer

Tab with different controllers

In my angular.js app I have a profile view with various tabs, each one a nested view with it's own controller. What I want to do is to be able to click back and forth different tabs but always remaining in the profile view. But every time I click on…
tvieira
  • 1,865
  • 3
  • 28
  • 45
1
vote
0 answers

Go to default route on page refresh with AngularJS

If I am at certain route, I would like to go back to default route if someone hits F5. How can I do this?
Zen
  • 11
  • 2
1
vote
1 answer

AngularJS: Best practices for routes and controllers

on our company, we're currently working on a single page web application. Users can login and fill their profiles with data and share those with other subscribers (it's a social network-ish application). Now, I've imagined this schema: the users…
1
vote
3 answers

How to ignore route param in location

I am navigating to next page as: $location.path("XXX/YYYY/"); current view has URL parameter as: http://www.go.com/?a=true; now when I navigate, it has XXX/YYYY/"?a=true; I have tried : delete $routeParams.a; and delete $location.$$search.a; But…
Furqan Misarwala
  • 1,743
  • 6
  • 26
  • 53
1
vote
0 answers

AngularJS ngRoute not working on mobile chrome

I'm using AngularJS 1.4.7 for a web application which works completely fine on the desktop site. However when I load the page on my phone using Chrome the webpage doesn't load any of the routing that should be taken care of by the ngRoute component.…
Jujunol
  • 457
  • 5
  • 18
1
vote
0 answers

Error ngRoute only on smartphones browsers

my website is working well on computer browsers but when I'm trying to execute it on a smartphone browser I've an error telling me that I have an "Error: [$injector:modulerr]". I have included the angular.min.js (1.4.7) and the angular-route.min.js…
Noé VIRICEL
  • 208
  • 1
  • 3
  • 13
1
vote
2 answers

Angularjs routing with ngroute and ngview does not work for me.Clicking on a link does not load the intended page

There are some 3 links(Home, About, Contact) in the index.html file. On clicking them, I should be able to display new messages/html(home.html, contact.html, about.html) files as defined in script js. But that does not happen. There are otherwise no…
1
vote
1 answer

ngRoute not working with external controller files

When I include my controllers in my app.js file, routing and controller functionality works fine. It looks something like this: index.html
GetOffMyLawn
  • 1,362
  • 4
  • 14
  • 21
1
vote
1 answer

ng-route in AngularJS doesn't work

I am practicing AngularJS and have one problem: ng-route doesn't work even though I added angular-route.js. Here is my app.js file: var app = angular.module('app', ['ngRoute']); app.config(['$routeProvider', function($routeProvider) { …
1
vote
3 answers

Angular get value in URL

If I wanted to get a specific value from the URL within Angular I'm looking at how to parse this data. Example: http://localhost:1337/doc-home/#/tips/5?paginatePage=1 I want to get the "5" HTML:
user5154099