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
0answers
2 views
Routing working locally, not on Heroku servers
My AngularJS application won't route to /login when accessing /login directly. It will route to /login if I first access / then route from / to /login.
It is working on my local environment but not ...
1
vote
1answer
35 views
+50
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('...
0
votes
1answer
167 views
How to reload the page in ui-router
i have a delete button, for the confirmation from the user, i am using directive for modal.
this is the directive code
app.directive('modal', function() {
return {
template: '<div ...
0
votes
2answers
36 views
UI router state not loading
I have configured some basic state pretty much as it should but it seems the template is not injecting in <div ui-view></div>.
Here's my code.
https://plnkr.co/edit/...
3
votes
2answers
9k views
Can access $stateParams in “view” but not in the controller
I'm going through the AngularUI Router sample app in http://angular-ui.github.io/ui-router/sample/#/
I think I understand in general what is going on and have been able to implement something similar ...
1
vote
3answers
2k views
ionic $state.go redirect does not load ui correctly until click
I am using ionic with firebase, and am trying to redirect upon login to the home page. The $state.go redirect does work, however I have a hidden tab called 'Profile', that I do not show until the user ...
0
votes
0answers
12 views
Semantic-UI Tab + AngularJS ui-router
TL;DR If I have 2 tabs, each tab with a <ui-view>, how can I choose which ui-view in which to load my $state?
I am using Semantic-UI tabs to create a new tab in my project. I have the tabs ...
0
votes
0answers
10 views
Angularjs - Tab key not working on redirections
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 ...
0
votes
0answers
6 views
Root state with resolve before header/footer view is loaded
I'm trying to implement a root state with a resolve, which is using a Websocket connection to initialize some variables. This must be done before any other Angular controllers are called. There are ...
1
vote
2answers
25 views
AngularJS: Cannot reach variable in the controller after ui-router resolving
I have following code in config. I use ui-router
template: "<employee-info-component user='$resolve.user'></employee-info-component>",
resolve: {
user: function () {
...
0
votes
0answers
19 views
Angular UI-Router redirect after resolve
I have a parent and a child state:
.config(function ($stateProvider) {
$stateProvider
.state('products.show', {
parent: 'products',
url: '/{id}',
...
5
votes
1answer
2k 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
2answers
238 views
Browser back-button does't work correctly after window.location.href was changed
Before my application was written in jQuery and wasn't SPA. I have rewritten some of the pages to AngularJS and made them SPA.
Now I need to have proper comunication beetwen these apps. Because when ...
2
votes
1answer
23 views
$stateParams empty ui router
I have a state as such:
.state('home.deletemsg', {
views: {
"contentworker@": {
url: '/delete/:entityname/:id/:redirectstate',
templateUrl: "Scripts/proteanapp/templates/delete.html",
...
0
votes
1answer
56 views
Is this good practice to use a single templateUrl for multiple states in Angular js? [closed]
I am using Angular frame work. I just want to know the way I am working is good or not ? If no what is the solution.
My requirement is if I login as admin I have one profile page
If I login as a ...
0
votes
0answers
23 views
Send parameter with ui-router based on ajax call
I try to find a solution for passing data from json feed and create dynamic templateUrl and controllerAs names. So far I have this:
$stateProvider
.state('all', {
url:'*anyUrl',
...
0
votes
0answers
32 views
How to fix this error The selector “app-component” did not match any elements in angular 2.0 application
I am getting an error in browser console when I click on the browser refresh button after running my Angular 2 application. It doesn't stop Angular 2 routing from one component to the other. Aside ...
0
votes
1answer
31 views
Why my Angular state is not being loaded?
At the start of my app, I have :
$urlRouterProvider.otherwise('/loading');
which brings control to my loadCtrl. Here I have:
Service.getRoleDetails(config.USER_DETAILS_URL).then(useRoleDetails, ...
0
votes
0answers
13 views
angular route Html5Mode set true throw error “Page Not Found” after reload
Add this in my app.config
$locationProvider.html5Mode({
enabled: true,
requireBase: false
});
And add base url in my index.html
<base href="/">
It's work, but when i ...
0
votes
1answer
40 views
How to redirect from NgOnInit?
I want to redirect, under certain conditions, when the page is loaded or before. For example, Cookies have to have something, then do a redirect.
this.router.navigate(["details"]); in AppComponent....
0
votes
2answers
30 views
Protecting views, authentication or canActivate for Angular 2 with ui-router
I thought I could try using ui-router with Angular 2.
Currently, I already have some default angular2-router configuration, which mostly comes down to something like:
export const homeRoute: Route = ...
2
votes
0answers
755 views
How to load css with ocLazyLoad in Angular?
I'm trying to use ocLazyLoad to load new css files when I change states with ui-router in a MEAN application.
The problem is that when I change from A to B state, all styles from A remains in B plus ...
0
votes
0answers
7 views
Configuring Angular UI Router Extras Sticky views within Angular 1.5 Component
I'm trying to implement sticky states on two "panes" within a view. However that view itself is an angular 1.5 component, which is run as a result of a higher level route match.
A simplified example ...
0
votes
0answers
13 views
$stateChangeStart params get overriden?
I am trying to get the returnURL to work after a successful login. But I am having little problem to solve it.
I am using $rootScope and listens for "stateChangeStart"-event, and it almost works. ...
4
votes
0answers
14 views
ui-router 1.0.0 beta and nested resolves: How to rewrite
I'm currently trying to move from ui-router 1.0.0-alpha.5 to 1.0.0.beta.3, and I don't know how to rewrite the resolve part of my states. I'm pretty sure it's relative to "9) BC-BREAK: remove support ...
2
votes
1answer
32 views
AngularJS: Resolving promise in ui-router config
There is code of mine $stateProvider:
$stateProvider
.state("home", {
url: "/",
template: "<employee-info-component user='$resolve.user'></employee-info-component>",
...
0
votes
0answers
16 views
Angular 1 app resets to root after declaring abstract true in parent view
When navigating to /part-1/4-int/1 the app defaults to / after declaring /part-1/4-int as abstract: true
Aim:
To have the <ui-view> in the parent (slides call) to be displaying children (a ...
0
votes
0answers
17 views
How to maintain the user session without data loss and without refreshing the page in Angular js
I have implemented an application:
Technology used: -- Angular, Mvc, WebApi.
How I have calculated the session in the application means?
When user login into the app, Set the logout time , Before 3 ...
0
votes
1answer
20 views
How to use bootstrap JS-plugins like accordion with angular single page application (using .otherwise method)
Here is a simple SPA with angular-ui-router
Plunker
However, i used bootstrap accordion in the accordion state but as u guess the accordion behavior doesn`t work unless i comment the otherwise ...
0
votes
1answer
16 views
UI-Router $stateChangeStart promise function
As you may already be aware I'm using UI-Router with my AngularJS app. I have a page which accepts user input, lets call it a profile page for this matter. Within this page I have a save button where ...
0
votes
1answer
14 views
sx-sref not being compiled to href
I have the following directive that I'm using to generate links (among other things). I've simplified it somewhat here:
oActivityModule.directive('activityDetails', function () {
...
0
votes
0answers
20 views
$state url mismatch with angular ui-router
I have the below two routes :
.state({
name: 'main',
url: '/main/:clientId',
templateUrl: '/main.html',
controller: 'mainCtrl',
});
.state({
name: 'mainDashboard',
url: '/{...
0
votes
0answers
4 views
How to force a parameter's value to be ommited in the url ui-router for anguar 2?
// Example Below
/*
The url to my update job is as below
http://localhost:9000/#/jobcreator/creator/updatejob/3c83ea7e-906c-437a-93ef-72f39888be9ca
I dont need the job id param to appear in ...
0
votes
1answer
28 views
What's wrong with my code to go to a child state in UI Router
Let's say I've configured an state as follows:
{
name: "results",
parent: "modules/globalSearch/main",
url: ""
// other settings
}
* Note that I'm not using URLs. "modules/globalSearch/main" ...
81
votes
11answers
126k views
How to send and retrieve parameters using $state.go toParams and $stateParams?
I am using AngularJS v1.2.0-rc.2 with ui-router v0.2.0. I want to pass the referrer state to another state so I use the toParams of $state.go like so:
$state.go('toState', {referer: $state.current....
0
votes
0answers
10 views
Access parent state's scope (nested views)
Given a multi-step form, each step has its own route.
There's a progress bar indicating what the current step is.
I set up the routes like this:
stateRoot (abstract) containing the progress bar
...
0
votes
1answer
16 views
Protect routes and redirect user based on some conditions with Angular ui-router
The scenario is:
For some routes in my app, I want to force user to complete their profile first.
There are a few ways to achieve that:
Redirect inside the user resolve (where we load the user data)...
0
votes
1answer
73 views
How to get data from Route or ActivatedRoute when subscribing to router.events.subscribe in Angular2?
I'm trying to get the data from a Router whenever the Route changes but I'm not having success. Here I set the asdf property
@NgModule({
bootstrap: [AppComponent],
declarations: [
...
10
votes
3answers
3k views
Replace ui-view with the loaded content
I have multiple views like here : http://www.funnyant.com/angularjs-ui-router/
And I load them in my page like this
<div data-ui-view="content"></div> --- 75% width
<div data-ui-...
1
vote
1answer
21 views
UI Router 1.0 state change events not working
I'm migrating my Angular 1.5 application to Angular UI Router 1.0-beta3 to use the component router. I'm listening for state change events on $rootScope but none of the events are fired.
Example:
...
59
votes
6answers
57k views
Angular-ui-router: ui-sref-active and nested states
I am using angular-ui-router and nested states in my application, and I also have a navigation bar. The nav bar is hand written, and uses ui-sref-active to highlight the current state. It is a two-...
1
vote
2answers
21 views
Is it possible to load a routerOutlet from a function in angular2
I want to load a routerOutles in angular2 without a button, but can't figure out how to do it. This is how to do it with a button:
<button (click) = "load()" ><a routerLink="/next" ...
0
votes
0answers
9 views
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:...
2
votes
3answers
2k views
Is it possible to replace/overwrite a ui-router state definition? (default state being “customized” by another module)
Is it possible to simply replace a state definition with a new one?
The use case I have is that one module defines the state, and I'd like to be able to replace that state definition from a different ...
0
votes
2answers
20 views
ui-router to resolve same object but with different data
I have the following example which resolves an existing product code by returning the results from my DB (ProductsFactory.getProduct) and then enters my editProduct state:
.state('editProduct', {
...
0
votes
1answer
28 views
Change nested views through ng-click in ui.router
I am trying to insert views inside view. But it is working only at the defined state but when I trying to change the view with the help of ngClick the state lost the path.
It is like
View 1
--...
0
votes
1answer
29 views
AngularJS When and Otherwise with UI Rout
I'm new angular student.
I have a problem with my routes of UI Route.
here is my code:
$urlRouterProvider
.when('/GRN', '/GRN/Produtos')
.when('/Executivo', "Executivo/Produtos")
....
0
votes
1answer
19 views
How can I maintain previous state param on 404?
I am new to working with Angular and I need some help with router-ui package.
Several of my states are made up of a dynamic value like so:
.state('state-name', {
url: `${dynamicValue}/state-name`,
...
0
votes
2answers
23 views
UI-router nested view not being injected
I have a root index.html file which has a ui-view tag, to which a main template file home.html is injected.
home.html has a ui-view tag which needs to change depending on the current route. I ...
0
votes
1answer
15 views
Set default nested state in ui-router
I have two level nested state on ui-router and I can't set a default nested state for some view.
I need to load the state cars.detail.supply.list when the state cars.detail is active without changing ...