$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
3
votes
1 answer
How to handle exceptions in resolve: clause of $routeProvider
Suppose a user needs to navigate from list page /people to detail page /person_detail?Id=12 by clicking a hyperlink pointing to a person detail page. Meanwhile another user deleted the person object with id=12.
This will cause a failure to resolve…

mkvakin
- 481
- 6
- 19
3
votes
2 answers
Multiple controllers for a template using routeProvider
I'm starting to develop my first big project using AngularJS and while I was thinking about the design for the app, I found something that I don't understand.
I was thinking in a single-page app, so I'm using ng-view and routeProvider to route each…

Jorge
- 193
- 3
- 10
3
votes
3 answers
Angular js - call a route without view
I'm trying calling the /auth/logout url to get redirected after session is deleted:
app.config(['$routeProvider',function($routeProvider) {
$routeProvider
.when('/auth/logout',{
controller:'AuthLogout'
//templateUrl: not…

itsme
- 48,972
- 96
- 224
- 345
3
votes
4 answers
How to append a stylesheet to in AngularJS $routeProvider?
I want to load a specific CSS file only when a user accesses the contact.html view on my AngularJS app/site. I found this answer which almost made sense to me How to include view/partial specific styling in AngularJS The accepted answer by…
user883807
2
votes
2 answers
Dealing with %23 replacing id # in angular routing.
The problem:
I have a express backend/angularjs frontend web app hosting all of my teams documentation for our users. We frequently need to post links to a specific question (all linked as ids) to our users in Slack. ex.…

Devon
- 21
- 5
2
votes
2 answers
angularJs routeProvider issue
I have the below mentioned Angular code that uses the config and the routeProvider. View1 and View 2 are also enclosed.
My test application

MidKar
- 46
- 4
2
votes
1 answer
Angular Routing; exlamation mark beside hashtag in url
I trying to do routing but i can't.
Related codes in app.js;
var app = angular.module("app",['ngRoute']);
app.config(["$routeProvider",function($routeProvider){
$routeProvider.
when('/', {
templateUrl:'pages/home.php'
…

hakanz
- 81
- 6
2
votes
2 answers
angularjs laravel page refresh gives 404 error
Could you kindly tell me how can fix the issue of 404notfoundexception when I am trying to reload urls that was found using ngRouteProvider?
For example..
$routeProvider.when('/about',{
templateUrl:'partials/about.php',
controller:…

Nurul Alam
- 342
- 3
- 22
2
votes
2 answers
Unwanted hash '#' in url, using $routeProvider in angularjs
When I'm starting my application the following url is opened: http://localhost:8080/#/. What I'm trying to do is to open this url: http://localhost:8080/ when the application is loaded, but I'm not able to achieve this.
I'm using AngularJS and…

Daniel Stradowski
- 3,466
- 1
- 12
- 21
2
votes
1 answer
$scope in controller div not updating after routing change
I have ng-view partials that update based on routing changes in $routeProvider.
anmSite.config(function($routeProvider, $locationProvider){
$locationProvider.html5Mode(true);
$routeProvider
//Route for home page
.when("/", {
…

stones4yap
- 33
- 6
2
votes
1 answer
Using AngularJS with block-ui and routeProvider, page displays "Loading ..." after page load is complete
It's my first time using routeProvider with angular js. The project has two pages so far: home and user. Both pages load completely and interact with their controllers correctly. However, the text "Loading ..." appears at the bottom of both…

Lee Jenkins
- 2,299
- 3
- 24
- 39
2
votes
3 answers
$routeProvider.when('/', ...) has no effect, when html5 mode is on
Solution to the problem: url you write in base tag should have a trailing slash.
I have the following routes configuration, but template is not requested, if html5 mode is on. No errors, no attempts to get the resource from the server.
Neither…

Pavel Voronin
- 13,503
- 7
- 71
- 137
2
votes
0 answers
How to switch a component in html template using routeProvider in Angularjs
The question already says it. My code looks like that:
(function () {
"use strict";
angular.module("homeApp", ["ngRoute", "componentsApp"])
.config(["$routeProvider",
function ($routeProvider) {
$routeProvider.when("/", {
templateUrl:…

Sknecht
- 984
- 2
- 11
- 31
2
votes
1 answer
Angular href='/' not resolving
I have a route configured to redirect to a default page /patients, and otherwise it sends the user to /login. Currently if I navigate to localhost:, I get the default page. The problem arises from wanting to click on the logo with href='/'.…

Kraken
- 5,043
- 3
- 25
- 46
2
votes
0 answers
AngularJs - Unable to pass object using routeProvider
I load some data from the server, and then update the view using ng-repeat. The user has the ability to edit the data in another page. Now, is the part where I'm a bit confused. I can pass some parameters using $routeProvided combined with…

Alex
- 1,982
- 4
- 37
- 70