Tagged Questions
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.
0
votes
1answer
10 views
Components aren't being injected into my ui-view
I'm just trying to setup a boilerplate for angular 1.5.9 with UI Router 1.0.0. I can display my parent state component within the ui-view, however when I nest states within my parent, my components ...
-1
votes
0answers
8 views
Error using resolve with UI Router => angular.js:13920 Error: [$injector:unpr] Unknown provider: simpleObjProvider<- simpleObj<- EnrichingController
I am trying to use ui router with resolve and it is showing the error message :
This is app.js
var app = angular
.module('CoreServiceApp', ['pasvaz.bindonce','ui.router','ngResource','...
0
votes
0answers
9 views
Detect that URL has been changed by ui-router, not by user?
I have a SPA angularjs application and have tabs within the application. Every click on the tab has different URL. But every time the URL changes, the page has to do something. I have to separate the ...
0
votes
1answer
9 views
How to use interpolation inside ui-sref
I have states like this:
.state('portfolio.work1', {
url: '/work1',
templateUrl: 'app/portfolio/work1.html'
})
.state('portfolio.work2', { ...
1
vote
1answer
5k views
Uncaught ReferenceError: $stateProvider is not defined Angular UI Router
For some reason I'm getting this error Uncaught ReferenceError: $stateProvider is not defined even though angular-ui-router.js is being loaded fine.
the error in Dev Tools
here is my app.js
var ...
3
votes
3answers
10k views
UI router Unknown provider for injecting service into child state resolve
Got Unknown provider when injecting service into the child state resolve function. But if defined a resolve in the parent state, it just works. Below there are some sample codes:
I defined a service ...
2
votes
2answers
59 views
+150
How can I prevent persistent URL anchor link hash values with UI-Router?
I'm using Angular2 and UI-Router 2 in no-hash mode for a simple app with some anchor links in the menu. For example:
https://example.com/blah/blech
https://example.com/blah/blech#specifications
https:...
1
vote
1answer
24 views
Angular 2 - Child route
Got a problem with angular 2 routing, i try lots of things but i still have error message.
I got this url : /project/:projectId . Project page got router-outlet and can have access to this two urls:
/...
0
votes
1answer
83 views
AngularJS ui-view not getting javascript file of it's parent page
Initially when the page load all ui-view loaded and works fine But when i change the state ui-view not getting javascript file that loaded earlier in it's parent page.Although ui view gets the css ...
0
votes
0answers
19 views
How can I set an active dropdown item based on current state?
I have created a new directive which creates a nested dropdown menu from a link object in my factory.
This is outputted like so:
<button class="nav-item-idle" ng-click="vm.toggleDropdown = !vm....
0
votes
1answer
74 views
In the config function inside state how to use factory /service for the custom data properties in angular js
In the below example I have to use service inside roles how to use service and return array value from there
Example :
.config(['$stateProvider', '$urlRouterProvider', function ($stateProvider, $...
-1
votes
1answer
10 views
UI router - How do i create a nested state
I have a state as the following:
.state('main', {url: '/main', templateUrl: 'views/main.html', controller: 'Main'})
What I want to do is have another URL that is /main/details. This will be a div ...
1
vote
2answers
20 views
Injecting custom service into ui-router config throws error: Unknown provider: [Service]
I would like to inject my custom service into angular app in ui-router config function. So I'm defining router as below, but when trying to $inject service I get error: Unknown provider: Auth. Here is ...
1
vote
1answer
21 views
Not able to use UI-Router in AngularJS 1.x with query params
I am using UI-Router with AngularJS 1.5.9 and I try to handle the route '/reregister' with a query parameter in it.
I try to invoke this URL form outside (by a link):
https://myapp.herokuapp.com/#/...
0
votes
1answer
32 views
Can't retrieve params for a given id in Angular
Im building an application in Ionic and I need to display several things from list to details. Basically I have a Homepage that display all my content from a json file, and put it into a list
home....
0
votes
0answers
5 views
Angular-breadcrumb: label/parent relationship
I am trying to use ncy-breadcrumb in my application but I don't know how to solve one particular case.
First of all I have these 2 states:
{
state: 'installation-edit',
config: {
...
0
votes
1answer
41 views
weird ui-sref behaviour: old params still remain at URL although trying to change
This is my state definition:
$stateProvider
.state('app.reports', {
url: '/reports?param1¶m2',
templateUrl: 'app/modules/report/views/reports.html',
...
1
vote
1answer
22 views
Angular-ui-router templateUrl not working with Chrome and IE, but works for Firfox
Created a very simple Angular ui-router files to test, I found out "templateUrl" ('contact' state in my example code) in the stateProvider not working with Chrome and IE, but works for Firefox, ...
-2
votes
0answers
14 views
angular 1.5 component-router vs ui-router [on hold]
I am about to build a component-based architecture application with angular 1.5 and I want to know which router to use component-router or ui-router.
I know that component-router has some nice ...
1
vote
1answer
18 views
AngularJS UI-router Change the parent template url from client state
I'm using ui-router for my routing. I would like to know how I can dynamically change the parent templateUrl from a client state (edit state in this case).
angular.module('TestModule', ['ui.router'])
...
1
vote
3answers
37 views
Angular ui.router Reload Template
First of all, I'm sorry for a long question, but it just has to be like that. Unfortunately...
I have a couple of templates and a couple of routing logic, all linked in separate files. For some ...
0
votes
0answers
22 views
+50
$mdDialog with ui-router
I'm trying to use angular-ui-router ui-views (with nested views) inside an angular material mdDialog, but I cannot find anything on how to achieve that. Is it possible? Or should I use another ...
215
votes
16answers
236k views
Reloading current state - refresh data
I'm using Angular UI Router and would like to reload the current state and refresh all data / re-run the controllers for the current state and it's parent.
I have 3 state levels: directory....
0
votes
1answer
23 views
route to specified number of views in angularjs
I am in the process of building a mobile web app with AngularJS. The app will allow the user to record the salary and other figures for employees.
On the first page the user will select the number of ...
0
votes
0answers
17 views
ui-view shows data on first click of a tab but fails to load the same data on subsequent clicks
I am using angular 1.5.I am trying to load two templates called roles.html and applications.html. The page get loaded on first click of applications tab or roles tab in nav-bar,but fails on subsequent ...
23
votes
4answers
11k views
How to redirect in a ui-router resolve?
I am trying to redirect inside a ui-router resolve and wanted to know if there is a way to reroute in a router resolver. Currently this does not work as one would think.
resolver(auth, $state){
if(...
0
votes
1answer
57 views
Reloading only child state
I have nested UI states. I want to load only child state not the parent state.
Child State :
$stateProvider.state('app.test', {
url: '^/test?search',
controller: 'TestController',
...
0
votes
0answers
13 views
browser back button breaks , angular ui-router
I am using angular 1.2.26 . I am doing statefull routing in hashbang mode.
$urlRouterProvider.
otherwise('/comments/');
var comments = {
name: 'comments',
url: '/comments/:...
0
votes
0answers
6 views
Angular 1 Material FAB inside Angular 1 component not sticking bottom right
On my main page I had this with Angular 1 Material with ui-router:
<md-button class="md-fab md-raised md-primary md-fab-bottom-right" aria-label="Add FooBar">
<md-icon>add</md-icon&...
0
votes
1answer
16 views
angular-ui route won't load controller
.state('app.match.indicator.speciality',{
url: '/speciality/:jobId?',
views: {
'[email protected]':{
templateUrl: ENVApp + '/views/match/match....
0
votes
1answer
18 views
Angular 1 Ui-router - transition to next child sibling
I can't quite work out from the documentation on ui-router about how to transition between sibling states effectively using $state.go()
Consider a child state whose url is integer based:
/parent/1, ...
0
votes
0answers
15 views
UI-Router, default child didn't working
I want to have a parent page html, that has the controller shared by it's child view.
Here is my routes.js
export default function routes($stateProvider) {
'ngInject';
$stateProvider
.state('...
0
votes
0answers
16 views
Not able to type in Input on IE11
I'm not able to type in Input on IE11 with a very specific scenario and not sure if this is an IE bug or anything to do with libraries I'm using: angular, angular-ui-router, recaptcha.
JSBIN Demo: ...
0
votes
0answers
10 views
Dynamically loading component in AngularJS 1
Angular 1 has introduced the idea of components, and ui-router 1.0 allows you to specify a component for a particular state.
But say I want to show in a new component dynamically, _not as a new state)...
2
votes
0answers
22 views
Angularjs - Tab key not working to change from one input to another
Tabbing between inputs is not working when the page wsa redirected using
$state.go('page.login');
or
ng-href
If I reload the page with F5 in some pages it works and in other pages is not ...
1
vote
1answer
18 views
Angular UI Router - Prevent re-running of parent state when switching between children
I currently have a state hierarchy in my application like so;
- module_base
- page_base
- tab_one
- tab_two
- tab_three
The page_base state is abstract and has a ...
0
votes
1answer
12 views
Issue with optional params on ui-router
Here is my route :
.state('befyne.front.pages', {
url: '/:rubrique/:sousRubrique/:pageSlug',
templateUrl: 'components/frontoffice/pages/views/page.html',
controller: 'FrontPageCtrl',
})
...
0
votes
1answer
20 views
AngularJS 1 approach for “new foobar” UI overlay
I'm using AngularJS 1 with angular-material and ui-router.
Does anyone know what the best practice is for providing a UI for some "new foobar" type thing? In other words, let’s say I have a ui.route ...
0
votes
1answer
46 views
After refreshing page how to store $stateparams param value in Angular Js?
In button click event my state is going to change from one state to another.thats way I am passing Id value by using ui-sref.
this is my button declaration for id:-
<button ui-sref="list({id:...
0
votes
1answer
28 views
How to change params value during transition?
During transition I would like to be able to change params values. In documentation I found a method to access target states params using params('to') method. In my code it looks like this
$...
3
votes
3answers
4k views
Warn user before navigating to a different view
I would like to warn user and get a confirmation before the user navigates away from certain pages in my application, like composing a new message view. Which events can i capture and cancel/continue ...
0
votes
0answers
19 views
Angular ui-router - Two way binding for objects in resolve in parent/child states
I'm stuck with a particularly bad inheritance issue. Essentially, ui-router will two-way bind data that is passed to a child state from its parent via resolve. Works great. However, if (from the child ...
25
votes
3answers
24k views
“optional” params in AngularJS states/views with ui-router
I have a customer search view that, by default, simply loads a form for first and last name. It can, however, take those params as arguments in the URL. My app config contains:
$stateProvider
...
0
votes
2answers
31 views
want to remove # from my angularjs application
want to remove # from my angularjs application
i have tried $locationProvider, but there is no luck
here is my Config :
var TechdefeatApp = angular.module('TechdefeatApp',['ui.router']);
...
3
votes
1answer
563 views
angular 1.5 component, ui-router resolve, $onChanges lifecycle hook
In the following example (plunker), a ui-router state routes to an app component that has a data object and a replace method that replaces this object with a new one using the given value. In its ...
2
votes
1answer
56 views
ng-infinite-scroll with ng-show and sticky states
I am new to angular. In my single page web app, I have two tabs with ng-infinite-scroll in each of them. The two tabs are traversed between using a nav-bar,
<div ng-show="$state.includes('...
2
votes
0answers
35 views
Angular Material layout breaks when using UI-Router
I´m using Angular Material 1.1.0 with UI-Router 1.0.0-beta.1 in my Angular 1.5 project and UI-Router seems to break flexbox functionality.
The index.html layout stretches and fills the container ...
0
votes
1answer
22 views
Angular: How to combine usage of cache and ui-router resolved promises?
For an angular app, I was previously loading all data before displaying any page through the ui-router resolve. However, certain data was repeated, so I ended up caching the data via localStorage... ...
2
votes
1answer
127 views
Angular (angular-ui-router) - Access $stateParams inside $locationChangeSuccess interceptor
I've set up my route using angular UI-Router like this:
routes.$inject = ['$stateProvider'];
export default function routes($stateProvider) {
$stateProvider
.state('the/route', {
url:...
0
votes
1answer
28 views
Angular2 nested module routing with same routes
I'm facing a common problem in a backend app.
I got several ressources which can be viewed by consulting this kind of routes:
reports/view/:id
campains/view/:id
suts/view/:id
certifications/view/:...