$routeProvider
is a service of module ngRoute
that has a simple API, accepting either the when()
method which takes a path and hash of options including the templatePath
and controller
, which matches a pattern and otherwise()
method which allows us to redirect to a route if one is not found.
Questions tagged [route-provider]
299 questions
0
votes
1 answer
How to structure a search results page in AngularJS where the URL controls the search filter
I have a basic listing page where I list students. By default I'm listing all students with pagination. There are multiple filters I can set as well, such as student status, nationality, etc.
In my markup I have an empty div tag with ng-view. I do…

John
- 93
- 1
- 11
0
votes
1 answer
downloading files from nodejs using angular at client side
I have a simple angular app which has configuration like -
angular.module('app',['ngResource','ngRoute','ui.bootstrap','angularFileUpload']);
angular.module('app').config(function($routeProvider,$locationProvider){
…

Harshit Laddha
- 2,044
- 8
- 34
- 64
0
votes
1 answer
'Not Found' when routeProvider has id
I set my routeProvider as such:
routeProvider.when('/', {templateUrl: 'views/index.html', controller: 'IndexCtrl'});
// $routeProvider.when('/ayat/:surah/:from/:to', {templateUrl: 'views/quran.html', controller: 'AyatCtrl'});
…

Mohamed El Mahallawy
- 13,024
- 13
- 52
- 84
0
votes
1 answer
jasmine test for $routeprovider resolve in config block
i have the below in my module config block:
var appModule = angular.module('myApp',['ngRoute'])
.config(['$httpProvider', '$routeProvider', '$locationProvider', '$translateProvider', function ($httpProvider, $routeProvider, $locationProvider,…

Priyabrat Nanda
- 1,095
- 3
- 18
- 34
0
votes
1 answer
$routeProvider not invoking correctly
I'm a little stuck with a route provider i'm working with within my application. I'm using grunt to uglify all this so I'm starting to wonder if thats part of it?
Anyways some code samples with the…

cdnicoll
- 574
- 1
- 6
- 17
0
votes
3 answers
AngularJs - cannot cancel route change without disabling "expand menu"
The Picture:
The Html:
// the ng-class allow the expansion of menu
user1177440
0
votes
1 answer
AngularJS routeprovider with named groups stop multiple instance of controller
When i setup a routeprovider that contains a named group via .when('/search/:searchString', { when the page is loaded for each different :searchString it loads a new instance of the controller assigned.
This causes me a problem when i have a…

ozatomic
- 182
- 1
- 13
0
votes
1 answer
Access Angular Factory through Injection
I cannot get access to methods in my Angular Factory? I get "TypeError: Object # has no method 'method1'" error. My angular app looks like this...
myApp.js
var myApp = angular.module('myAngApp', [])
myApp.config(function ($routeProvider,…

user913129
- 99
- 2
- 10
0
votes
1 answer
How to get ensureLoggedIn working with routeProvider
I'm working on a node.js application, using Angular.js, passport and connect-ensure-login.
Only on refresh (F5), does the redirect in ensureLoggedIn seem to work and I get to the login page, otherwise I think the routeProvider for the one-page app…

bcm
- 5,470
- 10
- 59
- 92
0
votes
1 answer
AngularJS: Keep track of user input in the URL so the user can take advantage of browser's back/forward
AngularJS's official tutorial is a great example of my problem. When you enter a query and choose the way it sorts results at http://angular.github.io/angular-phonecat/step-12/app/#/phones, the url stays the same and user output is not stored…

Ivan Vashchenko
- 1,214
- 2
- 11
- 19
0
votes
1 answer
Angularjs same template and controller on different urls
I have an application which can run into two contexts -- 1) Global and 2) Client
When in global context the urls are like this mydomain.com/#login, mydomain.com/#register but when in client context the urls are like this…

Shamaila Tahir
- 988
- 2
- 8
- 17
0
votes
1 answer
Why isn't my basic routeProvider working?
I'm learning AngularJS, and I'm having issues with getting a simple routeProvider working. It's pretty basic, so I'm confused as to what I'm missing. I've triple-checked syntax and spelling, and I can't find anything missing. Help please!
Here's a…

knowbody
- 241
- 1
- 2
- 7
0
votes
0 answers
Angularjs - Dynamically populating $routeProvider
I have a need to create dynamic routing and I am unable to find anything that explains how I could do it..
If my route provider looks like this:
app.config(function($routeProvider) {
$routeProvider
.when('/', {
templateUrl:'/index.php',
…

GRowing
- 4,629
- 13
- 52
- 75
0
votes
2 answers
Invoke function between two controllers while using routeprovider
I am using route provider as follows,
var appModule = angular.module('ngLogin', ['ngRoute','restangular','btford.socket-io','ngSanitize','xeditable']);
appModule.config(['$routeProvider',
function($routeProvider) {
…

Hulk1991
- 3,079
- 13
- 31
- 46
0
votes
2 answers
Routing does not work - angularjs - Uncaught Error: [$injector:modulerr]
I am new to angular js. I was just writing some sample application and I ran into problem with routes.
I am using cdn for angular