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
16 views
Clear out existing angular ui router query params when switching to the same route
I'm using angular ui router to route bewteen my pages and I have a route that has a few different query parameters. The problem is that when I switch routes for that same page with different query ...
0
votes
0answers
6 views
Angularjs ui-router angular-permission optional query string parameters
I need to have two optional parameter passed by url using the query string, I was able to reach this using ui-router ( plunker ) but is not working in mine application based on angular-permission for ...
0
votes
0answers
7 views
asynchronous templateProvider in uiRouter
Ended up with a little issue.
In my UI.state provider I wanted to use a function to get a menu based on a users access, and the users access will be determined by an API call.
All fine so far, have ...
0
votes
0answers
13 views
Angular-ui-router loading same template with different parameters
The goal
We have a number of views which we want to fill with the same template/controller. Each of them should receive an id which will be loaded without affecting other controllers. We don't want ...
0
votes
1answer
12 views
ui-router with codeigniter gives 404 when refreshing the page or pasting the URL with html5mode(true)
I'm using codeiginiter with angular-js and ui-router just like in this seed project , and i wanted to remove the /#/ from the url, so i used:
$urlRouterProvider.otherwise('/');
...
2
votes
0answers
24 views
event.preventDefault() with Angularjs and UIRouter removes browser history
I am showing a Javascript Confirm prompt when users click on a browser Back button by watching the $stateChangeStart event. Consider the following:
Users navigate from page 1, 2, then page 3. On ...
0
votes
1answer
29 views
$routeParams object getting empty in Angular JS
Below is the code Snippet that I am trying. I am not getting values from $routeParams, even it seems $routeProvider is not getting called. I am trying to click on the link and get values from URL ...
0
votes
1answer
17 views
ui-router automatically redirects out of state
I've got the following route:
.state('app.base.patient', {
url: '/store/:storeID/patient/:patientID',
template: template,
controller: patientCtrl,
controllerAs: 'vm',
resolve: {
...
0
votes
1answer
14 views
How to reload only one controller on url change in Angular?
I am using ui-router for my web application and I have defined 3 different views: header, content and menu.
When I choose a link from menu I want only to reload content view, rest of page should stay ...
0
votes
0answers
7 views
Fetch JSON object and there array using $resource
Here i am having a JSON as
{"veg":[{
"productname":"A",
"productimage":"products-images/p1.jpg",
"productprice":"50"
}],
"nonveg":[{
"productname":"nA",
"productimage":"products-images/p1.jpg",
...
0
votes
3answers
20 views
Angularjs ui-router add parent url parameter to current state
This is my app state
.state('app', {
url: "/?:site_id",
templateUrl: "/controls/angular/templates/partial/app.html",
abstract: true
})
.state('app.popup', {
url: "popup",
...
1
vote
1answer
11 views
How can I don't trigger $stateChangeStart in angular?
If I write like this:
$scope.$on('$stateChangeStart', function (event, toState, toParams, fromState, fromParams) {
if ($scope.isChanged) {
myShowOkCancelDialog(NotifyType.Warn, 'do you ...
0
votes
1answer
14 views
Authentication Logic - Server vs Client
I'm trying to get my head around where authentication logic should live in my application, the approach I am trying to take is to have any auth responsibility handled by the server, redirecting to a ...
0
votes
1answer
14 views
Is there any event before $locationChangeStart?
I want to re-init a service variable before every page loaded.
It seems $locationChange cannot match this needs in some condition
angular.module('xxx')
...
.service('xxxsvc', [..., function(){
...
0
votes
1answer
8 views
Nesting ion-nav-view inside nav-view
So folks, i was trying to have a template inside ion-nav-view but the state does not recognize it.
I wanted to have like
<ion-nav-view>
<ion-nav-view name="menuContent">
...
0
votes
1answer
31 views
My styles are only applied when I shrink chrome window
I'm using Bootstrap and AngularJS to build a single page app. I have an index.html file with a div tag in in the body of the html.
<!DOCTYPE html>
<html lang="en" ng-app="mainApp">
...
0
votes
0answers
9 views
Could not resolve ui-state mobile angular ui and ui router
I am using mobile angular ui and angular ui-router both in my project.
both has a same directive name ui-state. now I want to create a tab bar as demo of mobile angular ui. my problem is that when ...
3
votes
2answers
34 views
How to save persisting data in angular route service even on refresh?
So I am basically tranferring data between 2 pages in angular using $route service and not using url params.
I get the data sent to on the second page by the first page but when I refresh the second ...
1
vote
2answers
22 views
ionic ion-nav-view with 3 level not working
I have the following states:
$stateProvider
.state('app', {
url: '/app',
abstract: true,
templateUrl: 'templates/menu.html',
controller: 'AppCtrl'
})
.state('app.myClients', {
...
-4
votes
0answers
18 views
Using Angular 2.0 in a Angular 1 Style
Using Angular 2.0 ina Angular 1 Style. Hi i am sorry as i am asking this but it is important from most the developers perspective as a lot depends on it.
The Beauty of Angular was its simplicity in ...
0
votes
0answers
18 views
UI-router params work both ways?
I'm incredibly new to angularjs. I have a page that lists objects each of which are clickable. Clicking on an object goes to this second page where you list the parameters of that object. I use ...
0
votes
2answers
14 views
Angularjs redirect to https
How can i redirect http page to https ?
I have tried this code block in login.config, but it goes to http and navigate to https. I want to resolve https firstly.
resolve: {
data: ...
1
vote
1answer
29 views
AngularJS & UI Router : Why do $state.go() and $location.path() not work in interactive console?
See this plunker : https://run.plnkr.co/mTN6nIsUkxFtiZLx/#/state1
https://plnkr.co/edit/KYQG3OMPoCthEDcus12Y?p=info
It's basically the demo code presented on UI Router documentation. To test ...
0
votes
0answers
22 views
can the index.html be defined as one of the states too?(angularjs)
Im working with angularjs and know very little about the ui-router working. I have a usual index.html file that helps me display a certain list of elements , each of which are suppose to act as link ...
0
votes
1answer
17 views
is it possible to have multiple views inside multiple views in angular ui-view
Is it possible to have multiple named views inside another named view like this
<div ui-view="1">
<div ui-view="a"></div>
<div ui-view="b"></div>
<div ...
0
votes
1answer
28 views
Create a non abstract parent with a URL
I have a simple form that can be used to initiate a forecast request. I created this as a parent state requests (Initiate Forecast).
Desired behavior
When a request is submitted, that immediate ...
0
votes
2answers
27 views
'state is not defined' in Angular typescript controller
I am new to typescript and am trying to use UI Router's $state to navigate in my typescript controller. Unfortunately, I am still receiving a state is not defined error that I cannot resolve.
Here is ...
0
votes
1answer
32 views
Change URl without reloading in AngularJS
I am using the following code to change the URL without reloading in AngularJS. But when i use this function, if I go to other state from this controller it is re-initializing the same controller. How ...
0
votes
1answer
11 views
Get template if on the same page in ui-router [duplicate]
I have made a SPA where I used Angular ui-router.
My tester is giving me bug that if I am on the same template and navigating on the same page by clicking header menu, it happens nothing.
Can I ...
0
votes
1answer
32 views
UI Router: passing Parameters into ui-view
The UI Router manages states for AngularJS applications and supports nested views as well as multiple named views for the same state.
Multiple named views are used like this:
<body>
<div ...
0
votes
1answer
45 views
angular ui-router importing css
I want to load css on demand but I don't get it.
This is the file structure
index.html
<script src="js/ui-router-styles.js"></script>
<script src="js/app.js"></script>
...
0
votes
2answers
31 views
How to include my angular controller into my ui-router model
I am a newbie in angular. I want to include my controller lib/AppController.js into my ui-router module to display on the index page. Kindly help
here is my
index.html
<body>
<div ...
1
vote
1answer
21 views
How to instantiate some objects in service before controller uses the service objects when its view is loaded
I have a stateprovider which loads view and setup controller. Now the controller depends on service which should provide updated objects. For example, i have a state - s, with template v, and ...
0
votes
1answer
32 views
angular-ui-router error - Error: invalid 'handler' in when()
I am using angular 1.5 and angular-ui-router version 0.2.18
My app.js file looks like this:
import angular from 'angular';
import uiRouter from 'angular-ui-router';
import 'angular-ui-bootstrap';
...
0
votes
0answers
19 views
$state.go() clears $historyStack in ionic
In Ionic I got a slider in one tab. On click on a slide I want to jump to a subpage on another tab. I achieve that using
$state.go('^.station', {stationId:clickedSlide});
I get to view alright, but ...
0
votes
2answers
21 views
How should I create state using $stateProvider according to folder structure in Angular JS
I am using $stateProvider for routing. Here is my folder structure
app
-css
-style.css
-js
-app.js
views
-home.html
-list.html
index.html
Here is my state code
...
1
vote
3answers
55 views
How to get current Controller $scope inside directive function in angularjs?
Sample Link : Example
Hi all,
I created one Global Help button in index file based on url am loading dynamic help(html file) which is working fine. I need to identify which controller is activated ...
1
vote
0answers
23 views
When i reloading the page state.params are coming null
I am using ui-routing in my application and its working very nice but now I am showing content on a page according to the $state.params and when i come from an other link on that page then ...
0
votes
0answers
21 views
angular - freestanding version of ui-router urlMatcherFactory
I have a project that uses angular ui-router, but I don't actually need the router part. I use it almost exclusively for the $urlMatcherFactory for getting data from the url, such as this;
var params ...
0
votes
0answers
13 views
How to structure nested views in ui-router in Angular?
I'm making a categorization tree. I'm using ui-router.
I have some nested views like so:
<!-- index.html -->
<div ui-view="">
category goes here
</div>
<!-- ...
0
votes
1answer
41 views
Angular services: is it bad practice to assign response to an object or should I only use resolve
I have seen this code, which works for me but I wonder if it's bad practice to create an object inside the service- assign it to this and then to assign the response to the object in the success ...
0
votes
0answers
19 views
How to structure recusrive categories in Angular, perhaps using ui-router?
I'm a beginner Angular guy and I need some help structuring an application. The part I'm having difficulty with is a categorization system.
The Category model has the fields: title, slug, parent ...
0
votes
0answers
27 views
Angular.js ui-router module route helper provider
I am very new to Angular.js. I'm following John Papa's angular style guide, and I do not understand this section about a route helper provider (https://github.com/johnpapa/angular-styleguide#routing). ...
0
votes
1answer
32 views
AngularJS view without using main ui-view template?
I'm creating an application that provides a logged in user with the ability to create a poll (with questions and choices) in their dashboard.
Once the poll has been created I would like to redirect ...
0
votes
0answers
18 views
Angular controller survives logout
I use ui-router and $rootScope.broadcast to send actions (e.g. save) from a toolbar to other views/controllers. The problem is when i logout and login again, a new instance of my controller is created ...
0
votes
0answers
19 views
Angular force re download script
Im trying to force the browser to re download my js script when there is a new version available: I have an http-inspector for that:
'response': function (response) {
return ...
1
vote
1answer
34 views
Angular ui-router user authentication check
I'm trying to create a very simple authentication control using ui-router. I do the checking in the backend, though, I want to redirect users if they aren't logged in.
However, when I try to visit ...
1
vote
1answer
30 views
AngularJs and Angular-UI-Router routes permissions
I'm facing an issue on how to implement route restrictions based on remote data gotten from the server.
Suppose I have the following config file:
angular.module('myApp')
.config(['$stateProvider', ...
1
vote
2answers
34 views
AngularJs Open Route Page On Modal
In my angular-message application I have an option to choose message from template.
I need open the template list as modal.
My problem is that I have a template list as controller + view
How can I ...
0
votes
1answer
30 views
What is the correct way to use $stateprovider
Decently new to Angular, trying to figure out the correct way to use $stateProvider.
here is my current setup
$stateProvider
.state('users_orders', {
url: '/users/:userId/orders',
...