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.
16
votes
4answers
8k views
Handling trailing slashes in angularUI router
It's been hours since I started working on this problem and I can't seem to get my head around the solution.
I have an app that may result in users actually typing in the URL. In such cases it is not ...
0
votes
2answers
21 views
set default view for ui-view in angular
I have a simple angular project structure
app
index.html
view
main.html
home.html
landingPage.html
Index.html looks like
<body ng-app="myApp">
<div ui-view>...
0
votes
0answers
27 views
AngularJS - Ui-Router-Extras & Sticky States
I'm giving a shot to ui-router-extras, in particular, to Sticky States but I'm having some problems.
I would love to have 3 independent ui-view in my index with their different template, controller ...
0
votes
0answers
26 views
nested view doesn't work using angularjs
I'm using ui-router, but one strange thing happens, the style which i put in 'parent' doesn't get loaded.
Here's how my folder and files look like
my route.js look like this
.state("home", {
...
2
votes
3answers
57 views
angularjs nested routing doesn't load layout
.state('home', {
url: '/',
templateUrl: 'index.html',
abstract:true
})
.state('home.dashboard', {
url: '/dashboard',
templateUrl: 'dashboard/index.html',
...
0
votes
0answers
21 views
cannot get error using angularjs with express.js
I've a file of index.html that has
<ui-view></ui-view>
in the body and below is my route.js :
var app = angular.module('dashboard', ['ui.router']);
app.config(['$stateProvider','$...
0
votes
0answers
19 views
ui-view doesn't render parent style and js
I have a folder structure like this
dashboard (folder)
-- index.html
route.js
index.html
And I my index.html I wrap my ui-view
<head>
<style type="text/css">
h1{color:red}
</...
0
votes
0answers
2 views
Integrate magento with angular
I am trying to find out the best solution for a new application.
This application will be built on Magento CE 1.9.2.
Due to the front end design which requires lot's of elements such as complex and ...
0
votes
0answers
16 views
UI-Routing to login page in Angular
I'm building an Angular application. I have a dashboard with several pages, but the dashboard shouldn't be accessible without logging in. It should also be noted that I'm using UI-Router.
Most ...
15
votes
3answers
293 views
Is it possible to pass param from state to state with angularJs?
I wish to pass a param from one store-state to the display product info in products-state:
My app - storeApp
.config(['$stateProvider', function($stateProvider) {
$stateProvider
.state('store', {...
0
votes
2answers
26 views
angularjs ui-view doesn't work with templateUrl
I have a folder structure like this http://i.imgur.com/X8p6Qhi.png
This is my index.html
<!DOCTYPE html>
<html lang="en" ng-app="cartApp">
<head>
<meta charset="UTF-8">
...
0
votes
1answer
21 views
Controller — Factory: passing parameters
I have this function in my controller :
$scope.goToPath = function ( path, pid ) {
$scope.pid = pid;
console.log("scope pid : " + $scope.pid);
$scope.edit = true;
$state.go(path)...
0
votes
1answer
8 views
unable to invoke uiCanExit - angular ui router 1.0.0 beta
I have the following routes file in components/app/app-routes.js:
export default
function AppRoutes($stateProvider, $urlRouterProvider, $transitionsProvider) {
'ngInject';
// reference: https://...
0
votes
1answer
14 views
What should be the location for keeping the html template files for using ngRoute in AngulatJS
I am trying to setup a new angularJS projects using ngRoute and facing difficulties in resolving the absolute path for keeping my template html files.
Below is my project structure:
webapp
- css
- ...
2
votes
1answer
43 views
Angular App breaking in Firefox
Edit: This problem is fixed. I found that there was a problem using "watch" as a name for one of my states in ui-router because of this issue in Firefox https://developer.mozilla.org/en-US/docs/Web/...
0
votes
1answer
34 views
How to convert this line from using ng-router to ui-router
I need to convert this line
$location.url('/im?p=' + peer);
to using $state, I can't seem to properly get it working. I have followed these stack overflow questions but I can't seem to get it right
...
0
votes
0answers
7 views
angular ui router - handling response errors
I've added an $http.interceptor to catch response errors and handle them accordingly. However, I've noticed that this approach doesn't work when changing a state param in the url and then hitting ...
0
votes
1answer
8 views
How do I extend a parent state's data in angular ui router?
I know that I can inherit a parent's data as-is, or overwrite it, but how might I extend it? For example:
$stateProvider.state('parent', {
url: "/parent",
template: "<div ui-view></...
0
votes
0answers
4 views
Transition to a New URL State Without Reload
I'm using Angular UI Router 1.0.0-beta.1. Trying to transition from a state like /myroute/new to /myroute/5. Since the state with the id of 5 is very similar to the new state, I'd like to not reset ...
1
vote
1answer
16 views
Webpack dev server doesnt show full url
I am launching my app via webpack-dev-server but instead of full url like e.g: http://localhost:8080/welcome webpack always show me http://localhost:8080/webpack-dev-server. Is there any options to ...
0
votes
0answers
17 views
including ui-router.js in HTML not working
I'm new to angularjs and I'm using ui-router for this but it throws Error: $injector:modulerr
Module Error in console.
What is the mistake?
I've included the script as well.
var app = angular....
0
votes
0answers
17 views
ionic and angular ui-router - nested views
I am trying to nest some views.
I have a main page (abstract) called APP
state('app', {
cache: false,
name: 'app',
url: '/app',
abstract: true,
templateUrl: './sections/menu/menu.tpl.html',...
0
votes
0answers
4 views
Wrong data in “stateChangeSuccess” EventListener
I am using angular-ui-router. When I access a page the first time via URL (or any time by browser refresh) I can access the desired data. But if I use links that are generated by ui-sref I do not get ...
0
votes
0answers
18 views
How preventen parent component to reloading in angular 2 in routing?
In my project I use parent components. On parent components template available <router-outlet></router-outlet>.
Routing files:
app.routing.ts:
import { Routes, RouterModule } from '@...
2
votes
0answers
29 views
Ui-router 1.0.0.beta1 $transitions.onSuccess from $rootScope.on('$stateSuccess',
In my AngularJS (v. 1.5.x), I'm converting my controller-based states to component-based states with ui-router 1.0.0 (currently in beta 1).
I'm having troubles catching state changes, that where ...
0
votes
1answer
24 views
Redirect to a respective single product page on click in angular UI router
In my home page i will fetch all the products which i get from JSON now if i click a particular product image it should redirect to another page where the respective product alone should display. I ...
0
votes
1answer
15 views
Angular ui-router nested states without nested views
Let's say I have a films app. It has Home/About/Films pages. Films page has subcategories: Comedy/Drama. Currently, I'm struggling with navigation. The Goal is when I click Home - it should render ...
1
vote
2answers
188 views
Angular ui-state with params type in typescript
What I know
When using TypeScript with angular's ui state, I can provide "type assertion" with the UI-Router definitely typed library.
Using this, I can inject $state and have code similar to the ...
0
votes
0answers
5 views
Maintaining active tab with nested views IONIC
I'm working on a project with two relevant states, both of them <ion-tabs>. I was playing around with $ionicHistory to see what can I use to achieve this, but the docs are incomplete and I ...
1
vote
1answer
22 views
Angular JS UI-Router not working
It doesn't display anything on view nor any error on console log. Have checked with case sensitives too still couldn't solve the problem. Saw other posts too still couldn't find where am making ...
1
vote
0answers
25 views
Reloading the page gives wrong GET request with AngularJS HTML5 mode and java spring in serverside
Here is my web.xml file
<display-name>PhysicalInventory</display-name>
<welcome-file-list>
<welcome-file>index.jsp</welcome-file>
</welcome-file-list>
&...
0
votes
1answer
142 views
Angular / Express hosting
Newbie question. I want to run angular on a linux box without needing node or express. I've created a website but not sure what tech is what, haha. I'm assuming I have a simple web server using ...
2
votes
1answer
3k views
How to create User-friendly and SEO friendly URL in AngularJs
We are working on website where we using AngularJs. Is there any way to make AngularJs user-friendly urls and seo-friendly urls
Want
application/#user/add
to
application/User/Add
In AngularJs.
...
2
votes
1answer
42 views
Dynamic routes from server data
I have some nested routes defined dinamically:
var res = [
{i:1,title:"title 1"},
{i:2,title:"title 2"},
{i:3,title:"title 3"},
{i:4,title:"title 4"}
];
app.config(function($stateProvider, $...
2
votes
1answer
19 views
UI-Router parent controller doesn't initiate
I'm using AngularJs UI-Router for my app, but I'm with a problem where the parent's controller isn't initiated.
This is my state structure:
.state('main', {
abstract: true,
controller: '...
1
vote
0answers
7 views
Angular js 1 : stateProvider … how to configure state and its child state once parent is resolved and then child
I am working on angular js state providers...I am using parent states and its child states.
For example ..
Parent state is 'home'(url:/home) and its child state is 'home.profile'(url:/home/profile)
...
2
votes
2answers
14 views
How to do variable routing in angular js
I have this problem & I am unable to find the solution for it.
This is an example of code where I am trying to route to variable URL routing
$routeProvider.when('/Book', {
template: 'examples/...
0
votes
0answers
24 views
How to refresh only the templateUrl in angularjs
How can I refresh the injected template in angular with a button, because I tried to do this:
$scope.refreshData = function() {
console.log("Trying to refresh...");
$state.go($state.current, {}, {...
2
votes
1answer
49 views
UI-Router v1.0+ $transitions Service in Angular 1.x
I am looking for something that would be somewhat equivalent to the pre 1.0 version of UI-Router's $rootScope.$on('$stateChange...' functionality. I am aware of the new $transitions service but can't ...
1
vote
1answer
66 views
Angular 2, How to display current route name? (router 3.0.0-beta.1)
I want to display the name of the route in the app.component.html template. I'm looking for a simple solution, something that can be written like this:
{{router.currentRoute.name}}
My current ...
68
votes
11answers
36k views
Set Page title using UI-Router
I am migrating my AngularJS based app to use ui-router instead of the built in routing. I have it configured as shown below
.config(function($stateProvider, $urlRouterProvider) {
$urlRouterProvider....
5
votes
5answers
8k views
ion-list does not refresh after $state.go is called
I am learning AngularJS and ionic framework using this tutorial:
http://www.htmlxprs.com/post/12/tutorial-on-using-parse-rest-api-and-ionic-framework-together
Everything works well up until the ...
0
votes
1answer
28 views
Getting [$injector:unpr] error using Angular.js
I am getting this below error while click on link using angular.js.
Error:
VM1186 angularjs.js:107 Error: [$injector:unpr] http://errors.angularjs.org/1.4.6/$injector/unpr?p0=UploadProvider%20%...
0
votes
2answers
23 views
Angular UI router - can't get my data in component after resolve
I have a router configured like this:
.state('home.view-profile', {
url: '/view-profile/:profileUrl',
template: '<view-profile input="$resolve.profileData"></view-profile>',
...
0
votes
0answers
17 views
customize url using ui-router
My folder structure is like this
index.html
app.js
view/compare.html
assets/js/angular.min.js
assets/js/angular-ui-router.min.js
i want a custom url for view/compare.html page like /compare only. ...
0
votes
2answers
21 views
pass value from one different app module controller to another app module service using $rootScope in angularjs
I am doing project in angularjs,my requirement is need to pass value from one different app module controller to another app module service using $rootScope
Here my part of code
Login module and ...
1
vote
1answer
25 views
Angular inject $state service in config to redirect to a state in an interceptor
I am using restangular and I have an interceptor. The idea is that for every response 401 the interceptor should redirect to a different state.
The problem is that angular does not allow the ...
2
votes
2answers
17 views
AngularJS: Construct ui-states from array of template strings
I have static template files (around 50) and I would like to construct ui-states from these template array
var templates = ['index.html','about.html','contact.html','careers.html']
and my state ...
1
vote
1answer
25 views
Passing the whole object with ui-router
First of all, I'm using ui-router.
Actually I'm passing the slug through the states and it's working perfectly, as you can see below:
.state('pages', {
url: '/:slug',
template: '<page-...
0
votes
0answers
20 views
How to implement this ui-router , view logic in Angular
My site has 2 parts : home page and dashboard
in angular we are serving from main index.html -> thats ok.
in my situation , i want to implement this kind of logic,
there is a ROOT state (probably ...