Questions tagged [angularjs-routing]

Use for ngRoute, the built-in routing module in AngularJS, which can map the browser URL to a defined route.

Is used for deep-linking URLs to controllers and views (HTML partials).
It watches $location.url() and tries to map the path to an existing route definition.

Routes can be defined through the $routeProvider API. The $route service is typically used in conjunction with ngView directive and the $routeParams service.

See:

Related tags

1283 questions
14
votes
2 answers

IE favicon disappeared when navigating other page in angular application

I found an issue with angular application. I have a the location provider setup to use the html5Mode true: $locationProvider.html5Mode(true); I noticed that the favicon is disappearing when navigating between pages. I'm using IE11 edge document…
14
votes
5 answers

What is the difference between an ng-controller directive and a controller in the route?

I worked through the tutorial on the AngularJS website and I noticed that in at step 7, they change how a controller is introduced into the application. Initially, they use a directive: ... However, it…
austin
  • 5,816
  • 2
  • 32
  • 40
14
votes
3 answers

Force AngularJS to reload a route although option reloadOnSearch is set to false

In the route configuration of my AngularJS application most of the routes are defined with the option reloadOnSearch set to false as most of the time a page should not reload when search parameter changed. But in rare circumstances I need a…
Flo
  • 27,355
  • 15
  • 87
  • 125
14
votes
1 answer

Cancel route and redirect to other route without displaying the original content in AngularJS

I want to check an http services to see if a user is authenticated and if it has permission to see the certain page (controller) in AngularJS 1.2.0rc1. I have this scenario: User A wants to visit http://www.example.com/content. Now this content…
Aldentev
  • 490
  • 2
  • 6
  • 18
14
votes
4 answers

How to remove index.html from url on website based on angularjs

I didn't find a way to remove index.html from the url, because like this looks really ugly. mydomain.com/index.html#/myview1 mydomain.com/index.html#/myview2 Is there a way to remove that part, like that url will be so clear where the user…
13
votes
2 answers

Assign multiple controller in $stateProvider.state

Probably this is an easy question for advanced angular users, but I did not find this issue somewhere well explained. So I was restructuring my code, when I realized, I have two controllers in a view, which is not a problem, when controller 'ACtrl'…
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
13
votes
2 answers

Angularjs + Typescript, How to use $routeParams with IRouteParamsService

I am using the $routeParams to pull in properties from the URI and set local vars to them. When I use typescripts typing to set the type of $routeParams, I can no loger access the $routeParams. How can I access the properties in the…
Xgongiveittoya
  • 753
  • 1
  • 14
  • 33
13
votes
2 answers

AngularJS: Resolve in RouteProvider - detecting Success / Failure?

I have got a resolve working on my routeprovider but I just return the promise so i don't know if its success or failure. This is what I have .when('/items', { templateUrl: 'views/items.html', controller: 'ItemsCtrl', resolve: { …
Martin
  • 23,844
  • 55
  • 201
  • 327
12
votes
5 answers

Angular ui-router resolve value as string

With ui-router, I add all resolve logic in state function like this; //my-ctrl.js var MyCtrl = function($scope, customers) { $scope.customers = customers; } //routing.js $stateProvider.state('customers.show', { url:…
12
votes
2 answers

Site navigation using ui-sref, how to remove ui-sref attribute when not available

I've setup navigation as follows, using ng-repeat, which works very well {{link.Text}} However, my navigation items…
mrb398
  • 1,277
  • 4
  • 24
  • 32
12
votes
4 answers

Redirecting to error page in Angularjs

I am new to AngularJs. I have a single page app with routes configured having a controller and a view. The view get loaded inside the element of the index.html page. Inside the controller I am making a http call to get the data…
zilcuanu
  • 3,451
  • 8
  • 52
  • 105
12
votes
1 answer

Set angular.js url root globally

I have an angular app that is hosted at my university server. Because the app is not in domain root (urls are constructed as follows: university.domain/~) all links and image srcs are broken (angular assumes that it is located in domain…
Nebril
  • 3,153
  • 1
  • 33
  • 50
12
votes
5 answers

Routing in angularjs for multiple controllers?

I'm trying to build a view - I've set up two controllers to practice, one's HeaderCtrl, with some data in it (site title, header background, etc), the other should have the main content of the page - MainCtrl. When defining the route, I'm doing like…
skxc
  • 275
  • 1
  • 2
  • 13
12
votes
4 answers

AngularJS: Multiple views with routing without losing scope

I'm trying to implement a classic list/details UI. When clicking an item in the list, I want to display an edit form for that item while still displaying the list. I'm trying to work around Angular's 1-view-per-page limitation and decided to do it…
Keith
  • 20,636
  • 11
  • 84
  • 125