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
22 views
$urlRouterProvider.otherwise('/') not working
What am I missing? Why would the Home template NOT load via .otherwise('/')? If I link to href="/#/" or ui-sref="home" everything works fine. However the Home template does NOT load if I try $...
1
vote
1answer
31 views
How do I setup angular ui-router states so that the main template does not refresh per state change?
As the user navigates between the sections(Dashboard and Project Details, etc) which all use the main template, the entire template is reloaded. I would like to see only the nested "main" and "appbar" ...
1
vote
1answer
26 views
Angular $http get parameters
I'm trying to figure out how to include query parameters in an Angular $http get call to a service to retrieve search suggestions AND then search, search is not working - I can get suggestions. I'm ...
0
votes
1answer
21 views
How to update only browser url, not the state in AngularJs
Lets say, there is application, that can be run for different units, with different names. Before, when user select another unit, we just reinstating controller, and load new data for new unit, this ...
0
votes
0answers
19 views
URL in ui-router is encoding improperly and won't show the templated information
I'm following a tutorial on getting started with Angular 1.x (to bolster my understanding of everything I learned over at Codecademy)and I've just gotten to the ui-router portion of the tutorial. Here ...
0
votes
1answer
18 views
I have 2 app.run method.how to halt in first method until promise is resolved?
angular.module('app', [
... ])
.constant('AppConstants', constants)
.config(appConfig)
.run((UserService, User) => {
'ngInject';
console.log('apprun')
UserService.acl()
...
0
votes
2answers
34 views
Getting error with angular
I'm doing a Rails 5 application.
I have a simple code for showing sign-in page.
var app = angular.module('app', ['ui.router']).config([
'$stateProvider',
'$urlRouterProvider',
function($...
0
votes
0answers
15 views
ui-router and htaccess for Angular 1(sub url not refreshing)
I can't get the sub url to work when refresh the sub url or go straight to it.
Here is my config for ui-router:
app.config(['$urlRouterProvider', '$stateProvider', '$locationProvider', function($...
0
votes
0answers
19 views
How to define multiple ui-views in ui router in webpack
how to define multiple views in UI router using Webpack
My example.component.js file
import exampleHtml from './example.html';
import headerHtml from '../view/header.html';
let exampleComponent = {
...
0
votes
0answers
35 views
Angular-UI-router resolve not working
I got this problem where when i use resolve in Angular-ui-router causes my site to do hundreds of get requests per second but not load the view. I am using the full MEAN-stack.
The views are created ...
0
votes
1answer
15 views
implementing angular-ui-router 'otherwise' state
If a user types myURL/ or myURL/#/ or even myURL/#/foo they get to my index page.
But if they type myURL/foo, they get a 404. This is terrible. They should instead be redirected to /.
I am trying ...
0
votes
1answer
19 views
AngularJS routes and search query
I'm building a small search engine using Angular and UI Router. I'm trying to figure the best way to transition from the home page (search submission) to the results page.
I have this for my home ...
0
votes
3answers
29 views
Angular JS : Post call is going in Success as well as Error Method
I know I amy look like foolish while asking this, but I am not able to figure this out.
I have written a service which handles the post call to the server. $q service is returning the promise back ...
0
votes
0answers
15 views
How to pass events between two child routes - AngularJs 1 and UI Router
I am having 3 routes
Search form [call it form-view]
Based on criteria show a table of records [call this table-view]
Once you select a row from table- show the details[detailed-view].
...
0
votes
1answer
26 views
how to make url with dynamic username in angular 1?
I am new to angularJs (version 1), I am trying to write a route for my application using ui-router.
My application opens on the browser using the below link:
http://localhost:8000/ that is converted ...
0
votes
0answers
20 views
Parent's state params empty on $urlRouterProvider.otherwise state reload
I have my state configurations defined as below:
$stateProvider
.state('parentState', {
abstract: true,
url: '/:tenantId/',
param: {
tenantId: {
...
3
votes
3answers
11k 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 ...
0
votes
0answers
10 views
Angular1 and Adsesne
I have an angular app. I am trying to log what pages are viewing the ads. I have my analytics and my Adsense accounts linked and I can see the data in the publisher view. I have embedded the analytics ...
0
votes
1answer
18 views
Use a provider to run a command onEntet
I'm using ui-router to change states in an AngularJS application. I have a provider that uses JavaScript to create a graph in the HTML where a div exists. Only one of the views has the div element ...
1
vote
1answer
28 views
Angular UI router Intialising
I am trying to use Angular UI router in my application. When I initialise the UI router instead of getting say, localhost:8000/#/ I get localhost:8000/#!#%2F.
My app.js is as follows:
angular
....
0
votes
2answers
1k views
Ui-Router $state.go() does not reload data
After post some data using Restangular, I want go to another $state and reload data from server using this code:
.directive('ngShowBook', [function(){
return {
restrict : 'E',
...
0
votes
2answers
30 views
how to integrate a static landing page with its own design at root route using ui-router
I am working on an angular js 1.x application by using ui-router and have come up with a bottleneck since I am new to angular js ,so please forgive me if I sound silly.
Problem:
I have a main ...
12
votes
4answers
2k views
Adding a SEO friendly Url Slug in Dynamic Views of Angular UI-Router
In an Angular setting, I have chose Angular UI-router to switch between views.
My config looks as follows:
.config(function($stateProvider, $urlRouterProvider) {
$urlRouterProvider.otherwise('/...
0
votes
0answers
28 views
angular-ui-router: $state.go not reloading the template
I have a template which is fetched from a web server in the route "items.all" this contains a list of items with delete buttons.
<a title="Delete" ng-click="main.delete(44)">Delete</a>
...
1
vote
2answers
45 views
angular-ui-router v 0.4.2 with Angular 1.6.1
i am basically trying to make a simple routing:
where i have defined the following in app.js
(function () {
"use strict";
var app = angular.module("productManagment", ["common.services", "ui....
0
votes
1answer
83 views
ui-sref include parameter in ng-repeat loop
I have this table:
<table class="table tenant-table text-center">
<thead>
<tr>
<th class="text-center">
...
1
vote
2answers
29 views
Ui-router - difference between {slug} and :slug
I use ui-router in my project, I saw both in documentation:
.state('app.restaurants.index', {
url: '/{slug}',
controller: 'listRestaurantsController',
templateUrl: '/app/user/views/...
0
votes
0answers
12 views
AngularJS ui-router keep state loaded in background
I am designing an AngularJS project in which one of the states loads a view with a flash object. How would I keep the flash object loaded in the background in between state changes so that the object ...
830
votes
14answers
189k views
AngularJS: Difference between angular-route and angular-ui-router
I am new to AngularJS. I find AngularJS quite interesting and am planning to use AngularJS in my big applications. So I am in the process to find out the right modules to use.
What is the difference ...
0
votes
1answer
27 views
Switch among different templates/views
I want to propose two layouts (ie, horizontal and vertical) for my contents. So switching in the selector will lead automatically to the corresponding layout. My current JSBin cannot accomplish this ...
0
votes
2answers
23 views
How to stop ui-router from reloading resolve when params change
I have an app with a base app ui router state...
$stateProvider.state('app', {
navigationTitleKey : 'app',
abstract: true,
url: '/?{param}',
views: obj
});
And then a child and grand-child ...
0
votes
0answers
24 views
ui-router multi level nested Views
I've a parent view/state called home under which I've three children names HomeOne, HomeTwo, HomeThree. Under HomeThree I'm trying to load a view which will be a child for two other children. When I ...
0
votes
2answers
532 views
angular-ui-router: Load template from external resource ( express app )
Is it possible to load a template from a other application (like a express app) via $http?
Or from an other external source?
0
votes
0answers
13 views
The best way to edit og meta tags in angular
I need to customize meta property="og:title" (for ex.) tags and I need some feedback for my code.
Some routes have custom og meta tags and ngMeta looks like over engineering for me, in most of cases ...
0
votes
0answers
17 views
Mocking async service in protractor?
When I load a view in my Angular app I load some data through angular-ui-routers resolve method.
$stateProvider.state({
name: 'myview',
component: 'myViewComponent',
url: '/...
3
votes
4answers
7k views
$state, $stateParams, getting undefined object
I am getting unexpected results from both methods.
I have my $state configed
$stateProvider
.state('status', {
url: "/status/:payment",
...
-1
votes
0answers
20 views
passing ui state from one angular module to another angular module [on hold]
Situation is like this: I have two angular modules: module1 and module2. I have a ui-router configuration associated with module1. Say I have two states in that: stateA and stateB. Also, I have two ...
0
votes
0answers
127 views
Using AngularJs and Angular 2 in same project with ui-router and ngUpgrade
I've a lot of older NG1 projects and I want to use NG2 for new projects, but I've a lot of old NG1 Components/Directives I need to use also in my NG2 Project. So I've tried to use NgUpgrade and ...
0
votes
1answer
29 views
Angular ui-sref, can't format date input
Trying to append a GET URL with a date, but it needs to be in the format "yyyyMMdd00".
Despite trying all the solutions here:
AngularJS - convert dates in controller
and
Binding value to input ...
0
votes
0answers
13 views
how to bind angular components with ui-router
I am trying to test angular v1.6.2 components and ui-router together but can't get it to work. Here is my
html:
<!DOCTYPE html>
<html lang="en" ng-app="rrrwamac">
<head>
...
12
votes
1answer
224 views
Change-detection not working properly in ng2 component after navigation via angular1 ui-router
In an application that uses ng-upgrade to use some new ng2 (V2.2.4) components inside a big ng1 (V1.5.9) app (using ui-router) I am currently seeing a very strange change-detection issue. As far as I ...
5
votes
1answer
803 views
Is there a way to access resolved state dependencies besides injecting them into the controller?
I need to access resolved data from a service or directive to do some general operations across the whole application.
The only way to I seem to be able to access resolved data is injecting it into ...
3
votes
2answers
169 views
angular-ui/ui-router $stateChangeError never fires for a state that does not exist
My issue is that ui-router $stateChangeError is not triggered by a "404" invaild state.
I know for sure that my on $stateChangeSucess fires correctly:
$rootScope.$on('$stateChangeSuccess',
...
2
votes
1answer
30 views
AngularJS Routing using ui-router
Is it possible to have routing as follows in angular?
I'm using ui-router for routing, Angular version is 1.4 FYI
.state('home', {
url: '/:city',
controller: 'HomeCtrl',
templateUrl: 'templates/...
1
vote
1answer
37 views
Angular Js Application with two different layouts
I have been working on large angularJs application which have multiple modules. Problem is that now I have to include static website in that application and that website have whole different layout ...
0
votes
1answer
60 views
Cancel a $transitions change ui-router
I am trying to cancel a $transitions change under certain conditions using ui-router.
In my run block, I have the following code:
$transitions.onStart( { from: 'createCatalog.previewStyles'}, ...
0
votes
1answer
22 views
AngularJS child route always redirect to otherwise using $stateProvider
I have this routing config and the problem is that whenever I access a child route, it always redirects to otherwise. Which in this case is /login
$stateProvider
.state('login', {
url: '/...
1
vote
2answers
67 views
AngularJS - UI Router - flickering after check login
i have this problem with angular: i have in my router system a control to the user's authentication. The code below:
// ROUTING
function config ($stateProvider, $urlRouterProvider, $locationProvider) ...
0
votes
1answer
22 views
Don't update URL
I have a piece of code, which displays a list of file names. Clicking on each file name shows its body on the right hand. And we could add files to the list.
After clicking on each file name, the url ...
1
vote
1answer
57 views
AngularJS $state open link in new tab using ctrl + click
I'm trying to open a link in new tab just like a normal link would open when ctrl + clicked, except it has ui-sref directive attached to it which generate a href attribute with /stateName?param1=test&...