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
20
votes
5 answers

dynamically loading the controller in angularjs $routeProvider

I currently have an AngularJS app with routing built in and it works perfectly with static controller property assignments. but what I really want to do is to dynamically assign controllers with different routes: $routeProvider …
Kia Panahi Rad
  • 1,235
  • 2
  • 11
  • 22
20
votes
4 answers

AngularJS - Need some combination of $routeChangeStart and $locationChangeStart

My problem is actually very similar to the one found here: AngularJs - cancel route change event In short, I'm using $routeChangeStart and trying to change the current route using $location. When I do, the console shows me that the original page is…
20
votes
2 answers

Which function is called each time url changes in AngularJS?

I have to make a queue of all requests simultaneously happening without waiting for the response from the previous request in angularjs.I have a loading function which shows the loading div each time I change the url route but its not ok to make an…
Amb
  • 3,343
  • 7
  • 27
  • 34
19
votes
1 answer

Unknown provider: $routeParamsProvider <- $routeParams

I am currently learning AngularJS & Ionic by creating a simple podcast app. I am trying to use routeParams to get the "itemId" but I am getting the following error: Error: [$injector:unpr] Unknown provider: $routeParamsProvider <- $routeParams <-…
18
votes
4 answers

what is the purpose of use abstract state?

I am working on my tutorial AngularUI project. I read all about states, nested states and abstract states. The problem is that I can't understand why and when I should use abstract state?  
17
votes
5 answers

AngularJS | handle routing before they load

I wish to create a simple authentication check for my routes by external service. I define the access requirements on the route object: $routeProvider .when('/', { templateUrl: 'src/app/views/index.html', controller:…
17
votes
1 answer

Redirect after user has logged in

I'm pretty new to Angular, and right now I'm just trying to get all my routes set up and working as I'd like. Setup: When a user navigates to certain pages (/settings for this example) the app should check if there is a user already logged in. If…
16
votes
2 answers

specifying AngularJS controller: benefits using ngController vs. $routeProvider

There are two ways (AFAIK) to associate a controller with a view template/partial: the route specified in $routeProvider and the ngController directive. Especially (but not exclusively) for simple routing, is there any benefit/efficiency of one over…
nshew13
  • 3,052
  • 5
  • 25
  • 39
15
votes
3 answers

How to avoid $compile:tpload errors on 401 status code response

We are developing a Single Page Application with AngularJS and ASP.NET MVC Json Rest API. When an unauthenticated client tries to navigate to a private route (Ex: /Foo/Home/Template) to get a template, it gets a 401 response from the Web API and our…
15
votes
2 answers

UI-Router: sequential resolve of parent and child states

I have two abstract states parent and parent.child, and an activateable state parent.child.grand. I want parent to be promise resolved before parent.child.grand gets its resolves executed. Why? Because a certain data which comes from the ajax…
srph
  • 1,312
  • 17
  • 35
15
votes
1 answer

AngularJS $routeChangeSuccess callback arguments

I'm new to AngularJS and am confused by the documentation regarding event listeners. The documentation lists the following for the $routeChangeSuccess event: $routeChangeSuccess Broadcasted after a route dependencies are resolved. ngView listens…
Eric B.
  • 23,425
  • 50
  • 169
  • 316
15
votes
1 answer

ui-router 0.2.8 , why the release dir is empty?

If I run bower install angular-ui-router --save the release dir (and there is no file named angular-ui-router.js in other dirs) is empty so I can't include the module in my script :( Do anyone know what the problem is ?
Whisher
  • 31,320
  • 32
  • 120
  • 201
15
votes
1 answer

AngularJS Dynamic loading a controller

I read a lot about lazzy loading, but I am facing a problem when using $routeProvider. My goal is to load a javascript file which contains a controller and add a route to this controller which has been loaded previously. Content of my javascript…
t00f
  • 563
  • 1
  • 5
  • 15
15
votes
1 answer

File download links with angulars UI-Router

I'm trying to create a simple link in my angularJS app to files that have been uploaded. I have no problem producing the link, as this is pretty trivial. The issue I have however, is that the routing system I have intercepts the link and tries to…
PaReeOhNos
  • 4,338
  • 3
  • 30
  • 41
14
votes
1 answer

AngularJS : How to use $state.go to pass querystring in nested state routing

How can I use $state.go to pass a query string into nested state routing? Code: .state('masterform', { url: "/masterform?action&assetId&contentTypeId&folderid", views: { content: { …
Shashwat Tripathi
  • 572
  • 1
  • 5
  • 19
1 2
3
85 86