Questions tagged [angular-ui-router]

UI-Router evolves the concept of an AngularJS Route into a more general concept of a State for managing complex application UI states. Most notably, it allows nested state/view hierarchies and multiple named views.

UI-Router

UI-Router is a routing module created by the Angular-UI team that replaces the built-in $route/$routeProvider in Angular.

Its most notable advantage is that it uses states which, while similar to routes, allow you to describe your application as a collection of states. A state being comprised of optional parameters, such as a url, template, controller and resolved dependencies. States can be nested (parent/child relationship), multiple views can be used in a single state, and urls can be appended or absolute.

A question that would be a good candidate for using the ui-router tag would:

  • Pertain to a project that is:
    • built on the AngularJS framework
    • using or is migrating to UI-Router (over $routeProvider and ng-view)
  • Not be easily answered by the UI-Router Github Wiki. Be sure to check the FAQ!
  • Show all the various files related to the issue. State configurations, Controllers, Templates, other.
10400 questions
3
votes
1 answer

AngularJS css styles lost when reloading page with parameter

I am building an AngularJS page using UI router for routing. My problem is that when I reload a page with a parameter the css stylesheet is lost :( The css file is referenced in my index.html like:
Jenny Pettersson
  • 241
  • 4
  • 17
3
votes
0 answers

How to use modal dialog of bootstrap to prevent default on angular -$locationChangeStart

I am trying to use modal dialog of bootstrap to ask for confirmation to navigate when the page is in edit mode. I am using $locationChangeStart event to find out change in navigation. I am using a bool flag to find if the current page is in edit…
3
votes
1 answer

How to use ui-router states with directives and "controller as" syntax?

When using ui-router, I setup states like so: $stateProvider .state 'product', url: '/catalog/product', templateUrl: 'app/product/product.html', The only problem is, I have my controller in a directive, not as a stand-alone controller…
Nathan
  • 7,627
  • 11
  • 46
  • 80
3
votes
0 answers

Preventing duplicate ui-view in AngularJS

The situation I have a ui-view component in my template:
And I have states A and B defined for this view. The problem When I go from state A->B, the rendered DOM looks like this: And I got 2…
Michael
  • 3,206
  • 5
  • 26
  • 44
3
votes
1 answer

Angular UI-Router Template Provider (Access to Locals?)

I need access to resolves in my templateProvider. The documentation says this is possible does it doesn't look like it actually works. Does anyone know if I'm doing this wrong or if it simply doesn't…
micah
  • 7,596
  • 10
  • 49
  • 90
3
votes
1 answer

ui router resolve is throwing error provider not found

I have got a ui -router state here var AccountParentState = { url: "/Account", views: accountrootview, stickA: true, }, AccountAddState = { url: "/add", views:…
Joy
  • 6,438
  • 8
  • 44
  • 75
3
votes
2 answers

AngularJS Module 'ui.router' is not available for my Djangular project

Django is a python web frameworks, AngularUI Router is an AngularJS module for heroic routing. Together they fight crime. Or they would if it could find the 'ui.router' module. Here're my imports: