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.
3
votes
0answers
213 views
Change url of angular-ui-router without reloading page
I'd like for changes in the URL to drive my application, and for changes in the application to change the URL, but not actually change state.
I have a route like this. The country/city example is a ...
3
votes
0answers
1k views
AngularJS ui-router state doesn't refresh on back
I have an app setup with 2 states, A and A.B done this way:
$stateProvider.state('A', {
url: "/A/{aId}",
controller: 'AController',
templateUrl: function($stateParams) {
...
2
votes
0answers
64 views
Authentication and Routing with Express/Passport, AngularJS and ensureLoggedIn not working on “/” url
I have a MEAN stack app generated with the Yeoman Generator Angular Fullstack generator. You should only have access to the site by logging in.
The repo for ensureLoggedIn is here
While logged out, ...
2
votes
0answers
364 views
Angular UI-Router $urlRouterProvider .when not working *anymore*
Question: Why won't the .when() in my $urlRouterProvider work anymore?
I've picked up a fairly robust angular app. The most recent issue I've been trying to fix with it has been the 'user ...
2
votes
0answers
55 views
UI-Router modal changes existing views
I'm trying to use ui-router to trigger a modal for a certain state, rather than changing the entire view. To do this, I implemented a slightly adapted form of what is given in the FAQ, as I'm using ...
2
votes
0answers
53 views
How should you handle major UI transitions when data changes?
My team and I are building a medium / large size AngularJS application and the controllers and views of a single page view can change dramatically depending on the data in 1 field:
if (order.state == ...
2
votes
0answers
69 views
How not to change url when show 404 error page with ui-router
I want to show 404 error page, but also I want to save wrong url in location.
If I'll do smth like that:
$urlRouterProvider.otherwise('404');
$stateProvider
.state('404', {
url: '/404',
...
2
votes
0answers
50 views
Angular-UI ui-router supporting infinitely nested states
I have a situation in my Angular app where I'd like to consider an infinitely nested state/route. For example, let's say that I have a person and I want to see the lineage of the family. I might ...
2
votes
0answers
542 views
How to lazy load views using ui-router and requirejs
I would to use https://github.com/angular-ui/ui-router with http://requirejs.org/ and load views only when they are needed. I have found the following example: ...
2
votes
0answers
173 views
Case insensitivity with angularjs ui-router
I'm building a new angularJS app, based from the AngularJS SPA Visual studio template (http://visualstudiogallery.msdn.microsoft.com/5af151b2-9ed2-4809-bfe8-27566bfe7d83)
this uses ui-router ...
2
votes
0answers
178 views
AngularJS ui-router update template state on error
I'm trying to replace the template of a state when the resolve promise catch an error, any way to do that?
For example:
.state('mystate', {
url:'/mystate',
resolve: {
myObject: ...
2
votes
0answers
1k views
Stop angular ui-router from reloading state's template and controller, if only params change?
I have state defined like:
.state("root.home.foo", {
url: "/foo/:id",
templateUrl: "/static/partials/home.foo.html",
controller: 'FooCtrl'
})
When in that state, I respond to a mouse ...
2
votes
0answers
1k views
AngularUI urlRouterProvider.when dynamic routing with optional parameters
I'm trying to create routes with optional parameters; apparently ui.route doesn't have that capability (even though ngRoute has since almost forever). So instead I have designated them as query ...
2
votes
0answers
171 views
AddThis conflicts with AngularJS URL state
I'm currently using Addthis's api to dynamically initiate buttons. Basically addthis.init() and addthis.button().
When I open up say the email option or any of the modal/popup boxes options. This ...
2
votes
0answers
369 views
Angularjs ui-router: Rewrite location with default parameter resolved
I have multiple nested states. Let's say:
departments:
/departments/:idDepartment
departments.group:
/group/:idGroup
departments.group.category:
/category/:idCategory
Each state has a resolve to ...
1
vote
0answers
23 views
Angular ui-router to accomplish a conditional view
I am asking a similar question to this question: UI Router conditional ui views?, but my situation is a little more complex and I cannot seem to get the provided answer to work.
Basically, I have a ...
1
vote
0answers
32 views
Using angular-ui-routing, why is my express routing not working?
I am using angular-ui/ui-routing. The problem lies with either my angular routing, or my server routing, I don't know which. My express routing is this:
var compositions = ...
1
vote
0answers
65 views
+100
ui-router resolve behaves strangely in Ionic
I started from a demo Ionic app (ionic start myApp sidemenu), and added a resolve to one of the views:
resolve: {
issue: function($q, $timeout) {
var defer = $q.defer();
//defer.reject(); ...
1
vote
0answers
29 views
Loading AngularJS controller code on state change using ui-router (lazily)
I'm working on an AngularJS app with a Rails backend. Using the Rails asset pipeline, I've been able to organise my javascript files quite nicely, but I've landed at a point where the amount of ...
1
vote
0answers
39 views
Scrolling website with angular: states/routing setup
I can't seem to wrap my head around a routing setup for a project I'm working on at the moment. I tried ngRoute, angular-sement-router, now trying ui-router, however I'm still struggling to understand ...
1
vote
0answers
59 views
Reloading state without refreshing ui-router
I'm using ui router, now I want to filter data using params in url (search part of url), without reloading state - I dont need to ask server everytime I want to find something in collection.
my idea ...
1
vote
0answers
68 views
AngularJS. Pass stateParams variable to custom state data
I have a state:
.state('user', {
url: '/user/:username',
breadCrumb: {
name: '{{pass here username from stateParams}}'
}
});
I need to pass $stateParams.username to ...
1
vote
0answers
27 views
angular ui routing : avoid refresh
For the given ui-route
.state('index.m', {
url: "m{path:.*}",
views: {
"viewContainer": {
templateUrl: "p/m.html"
}
}
I want to ...
1
vote
0answers
66 views
Angular-UI-Router nested views in Internet Explorer 8
I am having trouble with Angular UI Router displaying when using nested views in IE8. It appears to be able to go about 2 layers deep, and then after that I get the following error in my console:
...
1
vote
0answers
20 views
Add the same child state to different states
I was playing and trying to learn Angular.JS and faced this issue. I have different states that have list of thoughts. There is a button in each entry to see more details about it. The page with the ...
1
vote
0answers
110 views
mean.io / angularjs (routing with $stateProvider)
sorry to bother:
i've just spent a few days learning angularjs and (wow) managed to get mean.io running.
now i just can't believe i'm not able to add a new route to the example app (with ...
1
vote
0answers
32 views
Angular UI-Router not displaying template
I have come across a very weird bug. My UI-Router is set up as follows with the ui-view element in the home template.
.state('main.home.one', {
url: '/',
templateUrl: 'partials/home/one',
...
1
vote
0answers
57 views
How can I updated the url without reloading the page?
I have the following code that lets me update the url without reloading the page:
function SomeCtrl($scope, $http, $rootScope, $stateParams, $location) {
var scope = $rootScope;
...
1
vote
0answers
74 views
ui-router - Default substate based on data
I have a list of modules with module detail on the right side.
div
ul
li(data-ng-repeat="module in modules")
a(ng-href="{{getModuleHref(module)}}")
div(ui-view)
Both module list and ...
1
vote
0answers
52 views
AngularJS: Intercept non xhr requests
Is it possible to intercept non xhr requests with Angular?
I have this problem where if a user types in the URL, say /admin, the server returns a 401 if the user isn't logged in. But because the ...
1
vote
0answers
65 views
On initial load of my app why is the ui-router state not set?
When I go to my app at https://localhost/my-app/resources/index.html, I have logic to go to my self-defined default state. However when I want to go directly to a specific part of my app (i.e. ...
1
vote
0answers
288 views
ui-router ng-repeat with dynamic named views
I wanting to dynamically load views into an accordion with ui-router. The thing is, when I generate the views by name inside ng-repeat I can't load the views at all.
I know that someone else asked a ...
1
vote
0answers
583 views
RequireJS + AngularJS + Module: Dependency issues
I had my angularjs app setup in local and everything was working fine till I upload my code to the staging server. I now have issue with dependencies that are not respected but I can't see why. I ...
1
vote
0answers
33 views
Get ui-router's ui-view to repopulate default content?
How can I set default content for ui-router's ui-view without a template?
Right now I have something like this:
<div ui-view>
Default Content
</div>
As the states change, the view ...
1
vote
0answers
741 views
AngularJS Ui Router regex matching wildcard in url
I wonder if this is possible - I need to match the following URLs with one pattern:
/one/app/home
/one/two/app/home
/one/two/three/app/home
...
I understand that AngularJS routing doesn't support ...
1
vote
0answers
48 views
angular ui router resolve view not loading
I have a state configuration which can be abstracted to the following:
$stateProvider.state('myState', {
templateUrl: 'myPath.html',
resolve:{
'myData': function($q, ...
1
vote
0answers
60 views
Angular UI router structure for this type of application
I am building an reporting application that uses stacked tabs for navigation. These tabs are in a parent/child hierarchy as shown below.
When the user selects the parent tab (ex feature 2) they ...
1
vote
0answers
70 views
angularUI select dropdown displays data only after entering a character
I am using AngularJS v1.2.15 and angular-ui / ui-select. My select HTML is:
<div class="form-group col-md-3">
<div class="input-group select2-bootstrap-append">
<ui-select ...
1
vote
0answers
45 views
Display parent state templates while child dependencies resolve
My app has nested states and views. Parent states are abstract and reference header templates. I would like to define resolve dependencies in the child states and have the header templates display ...
1
vote
0answers
15 views
Is there a way to get a child state's stateParams in the parent state?
Let's say I have state accounts with controller accountsController and url /accounts
and a child state accounts.details with controller accountsDetailsController and the url /{accountId:[0-9]{1,4}}
...
1
vote
0answers
464 views
angular-ui-router with requirejs, lazy loading of controller
Could you help me to understand how to load controller in the example below before the view? It looks like the view is loaded just immediately while the controller is not loaded yet.
//app.js
...
1
vote
0answers
44 views
AngularUI Router redirection to child state
Right now, I have a file upload interface that is made up of a main file selection state and a child file uploading state. I want to add some sort of logic that redirects the user to the child ...
1
vote
0answers
82 views
Using UI-Router without defining urls
Link
I have a codepen example where I'm routing view inside a side menu (drag right to open it up) and changing view to create a pseudo sub-menu navigation.
Here's an example state provider from ...
1
vote
0answers
96 views
Angular UI-Router Can ui-view replace the original tag?
I want to be able to replace the original element tag with the template. This should basically operate the same as transclusion when using the "replace=true" property.
1
vote
0answers
82 views
Smooth Scrolling for Autoscroll in UI-Router
Is there a way to get the functionality of ui-router's autoscroll with smooth scrolling instead of jumping immediately to that place?
Or is there a way to add an eventlistener to all states that's ...
1
vote
0answers
495 views
Trouble understanding UI-Router and nested views
I'm setting up an AngularJS app using Angular UI Router using states.
In my app there are multiple pages, and two of them have a tabbed view. So I'm using nested views to display the pages that have ...
1
vote
0answers
66 views
Prevent blinking screen when using interceptor in angularjs
I use interceptor in order to catch 401 responses from server. When I got 401 response I broadcast a message: $rootScope.$broadcast('auth:loginRequired');
In the .run() method of my module I listen ...
1
vote
0answers
181 views
Angular UI select2 - shows [object Object] on tab switch
select2 with Angular seems to be working - however I'm using ui-router and I have different tabs.
One of my select2 inputs is used in two tabs and the ng-model is the same. While everything works, ...
1
vote
0answers
454 views
AngularJS 1.2 + ui-router
I am trying to migrate from Angular1.0.6 + ui-router to Angular1.2.
But unfortunately my ui-router implementation seems to be not working with angular1.2
To be noted, everything (ui-router) is working ...
1
vote
0answers
1k views
How to navigate to a child state using parameters from a factory using Angular.js and ui-router?
I'm trying to get angular ui-router to navigate to a child state using a parameter supplied by a factory which has a default parameter at the start in order to preserve the parameters across the app.
...