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
0
votes
1 answer

Stop a common template from being reloaded

I have an Angular application that depends on Angular ui-router. This application has multiple pages which share a common template such as the navbar: var app = angular.module('app', ['ngSanitize', 'ngResource', 'ngRoute', 'ui.router']) …
Dante
  • 10,722
  • 16
  • 51
  • 63
0
votes
1 answer

AngularJs - Dynamic Routes with Crud in 1 Controller

I am able to successfully utilize dynamic routes. I would also like NOT to separate CRUD functionality in my different controllers (ie. keep CRUD in one controller per object). Per this question, I altered my routes Using same controller for all…
Mike Jones
  • 475
  • 2
  • 5
  • 12
0
votes
1 answer

Subviews in Angular

So I am trying to render a subview within a template but I want to define the state inside of the subviews controller on click of an element. The reason for splitting it out from the main controller is that I will be having subviews within the…
Michael Tempest
  • 814
  • 7
  • 12
0
votes
0 answers

Make sure some object is loaded from server before $locationChangeStart event handler gets executed

I have a handler bound to $location's $locationChangeStart event. Within that even handler, some user object coming from the server is required. Below is the code (simplified) that I have: angular.module('myApp', []) .factory('userSrv',…
tamakisquare
  • 16,659
  • 26
  • 88
  • 129
0
votes
3 answers

AngularJs Routing without hashtag in link?

I've recently began learning AngularJs for web development and am loving it so far. However, I'm not so sure about having hashtags withing the link when routing between views. My main concern is how Google will cache the pages on the site and…
0
votes
2 answers

AngularJS Scroll to ID using routeParams

I'm making a single page app, that has subpages. The idea is, I have urls e.g home, about and contact. Each page then has multiple blocks. The blocks are set a minimum height, when page loads. The minimum height is the window height. This is…
CharliePrynn
  • 3,034
  • 5
  • 40
  • 68
0
votes
1 answer

routes in AngularJS and Angular versions

angular.module('appPTracker', ['ui.bootstrap', 'appPTracker.filters', 'appPTracker.services', 'appPTracker.directives', 'appPTracker.controllers', 'ngGrid']). config(["$routeProvider", function($routeProvider) { $routeProvider.when('/', { …
Neph
  • 399
  • 1
  • 4
  • 10
0
votes
1 answer

Angular app routeProvider confused in app mounted on sup path

My single page app is not mounted on the root, so the path to the app is something like http://…/sub/. I took care of the base by adding this to the HTML file: My routingProvider is set up the way you would expect it to…
Wilfred Springer
  • 10,869
  • 4
  • 55
  • 69
0
votes
1 answer

AngularJS redirect a route only on browser's back button

In my AngularJS application I'm redirecting the route to a specific page when the user isn't logged. To do that I'm using a variable on $rootScope. Now I would like to prevent the browser's back button when the user is logged. I would like to…
Atropo
  • 12,231
  • 6
  • 49
  • 62
0
votes
1 answer

Angularjs: How to create a optional route map param?

On AngularJS 1.1.5, I've got two mapped routes in the form: /category/:name/:article /category/:name I'd like to only have the latest, and route the param :article to a action. This action is actually expanding an element in a list, so I don't…
punkbit
  • 7,347
  • 10
  • 55
  • 89
0
votes
1 answer

Request url when html5Mode(true)

I have enabled $locationProvider.html5Mode(true). However I have django as backend. On /logout/ I need to ask the url directly to the server as if $locationProvider.html5Mode(false) or simply visiting: example.com/logout/ and not in the…
Diolor
  • 13,181
  • 30
  • 111
  • 179
0
votes
1 answer

how to trap angularjs route event when query string change

I have a angular route like /x?stage=list, I want to trap route change event when route is changed to /x?stage=details, I have try bind event "$routeChangeStart", "$routeChangeSuccess", however but they are not triggered when query string change. I…
Fred Yang
  • 2,521
  • 3
  • 21
  • 29
0
votes
2 answers

ngClick on anchor tags causing problems in Angular

I've got ngClick directives on the anchors tags inside my main navigation, to make the menu "disappear" off canvas after clicking it: It's functioning all right. However, I recently noticed an error…
0
votes
1 answer

How to pass objects into angular.js directives? Interpolated argument appears to be serialised

I'm trying to pass a JavaScript object into an angular directive. I'm invoking it like this: The directive looks something like this: directives.directive('thingBadge', function() { return { …
Joe
  • 46,419
  • 33
  • 155
  • 245
0
votes
1 answer

Angular routing with a star doesn't seem to work

The angular docs say: path can contain named groups starting with a colon (:name). All characters up to the next slash are matched and stored in $routeParams under the given name when the route matches. path can contain named groups starting…
Joe
  • 46,419
  • 33
  • 155
  • 245