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.

learn more… | top users | synonyms (2)

0
votes
1answer
25 views

ui-router view is always same if I try new route while previous not resolved

I have a menu with ui-sref on items. If I click on menu route '1', then click on menu route '2' before route '1' is resolved, then the view of route '2' gets stuck: Now I click on menu item '3'. I ...
2
votes
1answer
16 views

Angular + IE : State.go on button click not working

We are developing an angular app and are having trouble with IE / Edge. We do realize that angular dropped support for older IE versions, but we are fine with that. Anyway, even in IE9+ and Edge we ...
0
votes
1answer
19 views

keep user from going to other view ui-route

I am trying to add some sort of resolve/promise to this to keep the user from moving on to certain pages until they have created a profile, added a friend, etc. I have an app, a controller, and a ...
0
votes
1answer
40 views

How to get data from other states angular ui router

I'm trying to hide, show menu base on the data role in each state .state('index.admin1', { url: "/admin1", templateUrl: "views/admin1.html", data: { pageTitle: 'Admin view', ...
3
votes
1answer
46 views

html does not have access to object in controller angularjs

I want to show the object in view. The object itself is the controller, but the html does not have access to its properties (probably not see the model)! Maybe the problem ui routing? app.js (...
1
vote
2answers
157 views

How to retain ionic sidebar on every page?

I've been fiddling with ionic, but I've ran into an issue. If I make a new project with a sidebar, upon navigation to a child state sidebar button disappears and is replaced with a back button. How ...
1
vote
0answers
17 views

Firebase on auth allow access to views

I have set up Google Firebase email and password authentication. I am trying to deny access to my other routes except login/registration/forgot_pass routes. How can I limit the routes to authenticated ...
0
votes
1answer
12 views

Custom directive not displaying withing a ui-view

I have a custom dircetive "3-test-directive" which I want to call to display a text. When I use this directive in the page partial-home.html, it does not diaplay me with any text from the directive(it ...
0
votes
1answer
21 views

Meteor - Call function before state loaded using ui-router

We're making a meteor app using angular and ui-router to control the states. We want to show a promo site if the user doesn't have access to the main part of the site. There will be a flag on the user'...
0
votes
1answer
19 views

angular 2 router.navigate undefined

Im trying to use navigate.route but keep running into this error: TypeError: undefined is not an object (evaluating 'this.router.navigate') I can't seem to get this working so I was wondering if ...
0
votes
0answers
19 views

How to add custom string to angular application url without effecting the normal functioning?

I have an angular application working with angular ui-router. When I run the application from server the url is like localhost/..../index.html After I click on any state the url changes to localhost/...
1
vote
2answers
49 views

Angular ui-router: load values for data and params from service

I want to load data and params for each state once when the app loads from my service settings (this service returns also promise since data are loaded asynchronously). Something like this: .state('...
0
votes
0answers
19 views

Navigate to a route programatically in ui-router-ng2

I'm using ui-router-ng2 in an Angular 2 app. How do I tell the router, from JavaScript/Typescript, to navigate to a state? I'm looking for something like: export class SomeClass { constructor(...
2
votes
1answer
269 views

AngularJS ui-router html5mode not working on reload

First of all, I've tried a bunch of different solutions to fix this problem, but none of them worked for me. See links below. The problem: Currently I can't use html5mode with ui-router because it ...
2
votes
1answer
20 views

Provide ui-router resolved resources without injecting directly into controller

I'm working on an angular 1.5 app that makes heavy use of ui-router. We define our states like this: $stateProvider .state('jobs', { url: '/jobs', template: '<ut-jobs></ut-jobs>...
-1
votes
0answers
22 views

change $urlRouterProvider.otherwise in controller in runtime

I use $urlRouterProvider.otherwise in config of my angular app for set otherwise path. MetronicApp.config(['$stateProvider', '$urlRouterProvider', function ($stateProvider, $urlRouterProvider) { $...
1
vote
1answer
30 views

AngularJS Logout using $http then redirect

Right so I have a little dilemma here :). I'm working on a project that is built with angularjs and Laravel. Login is done with laravel which is out of AngularJs "scope", should I say. So in Front ...
0
votes
1answer
140 views

Creating nested route app in angular using angular-ui-router and switching between modules

I want to create angular nested routes in my application using angular-ui-router with multi sub-modules; In "ui-router" we can use multi views in our main app config as $stateProvider, but can't ...
1
vote
0answers
92 views
+50

“base href” adds directory path in routing urls using ui-router

Summary : When using <base href="/prod/public/" /> , it adds the directory path in routing urls e.x. http://www.example.com/prod/public/home My angular app is hosted in the prod/public ...
0
votes
0answers
20 views

$stateChangeSuccess doen't be fired

I have tried to send pageview data to google analytics. And I'm using ui-router on angular.js. ui-router version is 0.3.1 stable. So I added method run to handle $stateChangeSuccess but any state ...
0
votes
0answers
12 views

AngularJS 1.4 states to 1.5 components migration and how to approach component based architechure

There are good articles that explains the significance of components and how to migrate existing directive to components with angularJS 1.5. I am working on a medium sized project with ui-router and ...
1
vote
1answer
15 views

Adding configuration file to Angular 1 how should the file be structured in order to use it

I have been wanting to have a central place for a configuration file with angular 1.5.8 that I can use for switching from JSON file to localhost to dev server and various other things. I noticed $...
0
votes
1answer
19 views

AngularJS ui-router with templateProvider for A/B testing not rendering templates

I have created an angular app where I would like to randomly render two different homepage view when a user accesses the url. I have created the app.js file with the following code using ...
0
votes
0answers
23 views

Partial template load angular ui/ ui router

I have about 10 products and each of them has 3 sections (Details, Description, FAQ) and there is a lot of content for each one. So I am using the $stateProvider to change states in a click of <a&...
0
votes
2answers
39 views

asp net core with angular

I am having trouble finding a tutorial using asp net core with Angular 1 without using Razor. (I just want to use html) int the web project with a web api solution that will get the requests. I have ...
4
votes
1answer
72 views

Are there a progress with backporting Angular 2 Router into Angular 1?

As I understand ngComponentRouter (ngNewRouter) has been deprecated. And I didn't find any other alternatives but ngRoute & ui-router, which are obviously not designed to work with components.
3
votes
4answers
775 views

Angular UI Router: How to go to the same state with different $stateParam?

I am wondering how can I go to the same state, with different $stateParam? I was trying to go with: $state.go('^.currentState({param: 0})') However, it was not working.
0
votes
0answers
21 views

Angular 1.5 components and ui-router 1.0: Add attributes to inserted dom element

In Angular 1.5, the .component() was introduced and seems to be considered good practice. I am currently migrating to ui-router 1.0 which allows (and recommends) routing to components. So I refactored ...
1
vote
2answers
27 views

cannot switch between child state in angular ui.router

Following is my code and its codepen . I am unable to switch from nav4's child1 to child2, or child3, the url changes but the view doesn't, but after clicking on any child and then refreshing the ...
0
votes
0answers
18 views

Angular ui-sref-active=“active” not working on refresh

I have the following link <a data-ui-sref-active="active" data-ui-sref="contact" href="javascript:void(0)"> Contact </a> It shows as active when I go to that page by clicking the ...
0
votes
2answers
31 views

How to pass a value (which i got from ui-router) to a modal/view through state.js?

My state. js is like this .state('lab.new-equip', { parent: 'lab', url: '/{labId}/new-equipment', data: { authorities: ['ROLE_USER'] }...
1
vote
4answers
5k views

$stateChangeSuccess not firing on href-transitioning

Am I correct in my conclusion that $stateChangeSuccess won't fire unless I use $state.transitionTo? For instance: //in app config .state('detail.zoom', { url: '/zoom/{itemId}', ...
-1
votes
0answers
16 views

how can i add a preloader until first state is completely loaded in ui-view?

I'm using ui-router to load the views in the index, but the first state takes to load a lot and i want to set a preloader to show it until the state finishes loading.
0
votes
0answers
24 views

How to mask/hide parameter exposed via URL in angular-ui-router?

I've implemented Login with FB where I'm calling FB login API url with AUTHTOKEN variable in it. Facebook API actually authenticate user and redirect to my app url with the jwt token which will be in ...
-1
votes
0answers
13 views

how to ignore (ui-route state) for hash '#'?

I need to ignore a state to hash, emits an error on the console. console emit error (Could not resolve '#' from state 'app')
0
votes
1answer
16 views

Rejected resolve promise not caught

I am working partly from this post and this answer. I have this route: .state('barcodeQuery', { url:'/barcode', templateUrl: templatePath + '_BarcodeQuery.html', controller: '...
0
votes
0answers
12 views

Angular 1.5 using Angular 2 component router late time binding issue

I am having issues with passing variables to my child routes and rendering my page. So to access my input values from the parent route I use $routerOnActivate. I then bind my parameter to my ...
1
vote
1answer
36 views

Not able to display the object array values in the dynamically inserted view using angular Js

I have just started to learn AngularJS. I am trying to write this code with 3 files index.html and view1.html and view2.html . In index.html I have defined the module and controller function.In the ...
0
votes
0answers
17 views

Dynamically set parent with angular-breadcrumb

I am using angular-breadcrumb for my project I have a tree structure of product categories in my database. Following image can give you a hint about it. For example, I can have: Dairy -> Milk -...
0
votes
0answers
11 views

UI-router children layout sharing a stateparam id

That should be simple and immediate, yet I have hard time to setup nested views with different layout while sharing a $stateParam.id. The setup looks like the following : /feed/layout2/{id}/view a ...
0
votes
1answer
24 views

How can I manage elements dependent on angular $state change when opening a new window on $state.href?

I have a specific angular view that needs to be opened in a new window without certain elements displayed (header/footer, etc). At the moment I am achieving this by looking for the current state name ...
0
votes
0answers
12 views

checking for admin group before rendering route using $state.go and $urlRouter.sync()

I have an angular app. Every route has a required user group value. The field is required. .state('dogQuery', { url:'/dog', templateUrl: templatePath + '_DogQuery.html', controller: '...
1
vote
1answer
27 views

How to configure Angular $http to send requests to different host?

I have an Angular web app deployed onto Heroku that pulls static files from S3. I have RequireJS enabled to allow angular to lazily load controllers and templates. The problem is that when the app is ...
83
votes
2answers
40k views

What is the difference between $routeProvider and $stateProvider in AngularJs

Please explain the difference between $routeProvider and $stateProvider in AngularJs. Which is best practice.
0
votes
5answers
110 views

Angular state resolve not injecting into controller

I'm trying to get ui-router's resolve to pass its value to the controller portalsForUserCtrl. Here is the router: (function () { 'use strict'; var myApp = angular.module("myApp", ["common.services"...
0
votes
0answers
41 views

How to maintain state using angularjs ngRedux

Recently got to know a better way of handing states and persist data using ngRedux. But there is very less examples available on internet with ngRedux. There official guideline is quite difficult to ...
8
votes
5answers
6k views

Page reload fails when using Angular Ui Router with Html5 mode enabled

I am using Angular UI Router in my angular app and i have enabled HTML5 mode to remove the # form the URL by using $locationProvider in the config. var app = angular.module('openIDC', ['ui.router']); ...
-1
votes
1answer
12 views

How do we include a header which is a angular js component into our index.html

I have a header component ,which has its own html and js file ,How do i include this component in my main index.html
0
votes
1answer
37 views

Could I send TWO parameters over $stateParams

I am building an app with AngularJS, and the question is: I have links as part of a list of contacts that belong to a company, built with ng-repeat. After clicking it I should go to the details page ...
0
votes
0answers
10 views

Ionic navigation bar disappears when using component based views

I'm using Ionic 1.3.1 with Angular 1.5.8. When I use templateUrl + controller in route view declaration ionic navigation bar works fine $stateProvider .state("home.features", { url: "/...