Tagged Questions
0
votes
1answer
32 views
Nested Views in AngularJS not working
I have the following routing set up for my application:
$stateProvider
.state('mac', { // domain.com/mac
url: "/mac",
views: {
'body': {
templateUrl: ...
0
votes
1answer
13 views
Go to the error state and keep the URL to the state generating the error
I'm using this to catch errors and redirect to an error page
module.run(function ($state, $rootScope, translateService) {
$rootScope.$on("$stateChangeError", function (event, toState, toParams, ...
2
votes
0answers
23 views
AngularJS UI router $onLocationChangeStart event.PreventDefault does not work
I need a way to interrupt a user navigating to a new page when there are unsaved changes on the current page. I implemented a modified version of the solution here:
...
1
vote
0answers
16 views
Transition between two single-page-app pages within the same angular application
How could I move from a page that uses an ng-app="MyAppFrontEnd" and its own set of CSS and JavaScript to a different page that uses ng-app="MyAppAdminEnd" and has its own set of CSS and JavaScript?
...
0
votes
0answers
30 views
What is the most efficient way to filter a list of elements
I have a list of images, and a data.json file which looks like:
[
{
"id" : 1,
"description" : "",
"category": "bathroom",
"url" : "bathroom/1.jpg"
},
{
"id" : 2,
...
1
vote
1answer
29 views
Angular ui.router - Use resolve value in root child
i can't get this structure to work!
I am trying to resolve my sidebarActions when the parent root state is called so the value can be used in all root.child states.
When i use root as a parent i ...
0
votes
1answer
24 views
AngularJS UI-Router won't recognize a defined controller on the module
I'm in the process of learning Angular, and I'm trying to set up a state with a controller using ui-router. I have a main module named app.js, and then sub-modules based on different content.
The ...
1
vote
1answer
26 views
ionic routing issue, shows blank page
I started building ionic app on top of the sidemenu starter app. The starter app has a base state 'app' which is abstract and all the sidemenu pages are children of the app for example app.search, ...
0
votes
1answer
17 views
Angularjs Sub domains
I am hoping someone can help direct me a bit.
I am busy with a Angularjs application. I am using ui-router for routing,
and everything is going pretty well. I have a requirement to implement ...
0
votes
0answers
21 views
Waiting for parameters from ui-router to update causing blank data
I have a senario that has been causing me issues for the last few weeks now. I currently have a "homepage" that populates with data from a controller with sports stats. This data comes from a ...
0
votes
2answers
30 views
AngularJS ui-router subpages
I'm new to ui-router and I'm trying to add a class to my navigational items if it's the active page.
Here's my stateProvider:
$stateProvider
.state('home', {
url: '/home',
...
0
votes
1answer
15 views
angular ui router state being hit but no template returned
I'm using ng-boilerplate amd have the following folder structure
member
-add
--add.js
--add.tpl.html
-member.js
-member.tpl.html
inside add.js I have the following route defined
.config(function ...
3
votes
1answer
34 views
Observing state changes in angular-ui-router
As far as I understand, the usual way to get a notification on a state change is to put a callback on the $stateChangeStart event, like in this answer.
However, if I understand correctly, I could ...
0
votes
1answer
42 views
AngularJS not calling function on button click
I am using AngularJD to insert data into mongoose db. My index file has a div:
<div id="links" ng-controller="loginController">
<a ui-sref="login">Login</a>
<a ...
0
votes
0answers
6 views
ui-router sometimes doesn't change page in Internet explorer > 9
I'm using ui-router for an application. In IE > 9 the page routing eventually stops working. Especially if I manually change the URL path and hit enter. Sometimes clicking around the application ...
1
vote
1answer
38 views
route not working in angular
I've created a index.html page where I am defining 2 links as:
<!DOCTYPE html>
<html ng-app="test">
<head>
<title>My Angular App!</title>
<script ...
1
vote
1answer
24 views
AngularJS tag not coming up as link
I am new to AngularJS. I have created a basic website where I have added 2 links and I want to create route for the same.
Below is my index.html file:
<!DOCTYPE html>
<html ng-app="test">
...
0
votes
0answers
15 views
$location.search() not current in angular controller
I'm trying to wire ng-infinite-scroll in a simple search application.
Currently using $location.search() as an 'authority' looks best but, after setting $location.search() it reads incorrectly later. ...
1
vote
0answers
20 views
Confusing $locationChangeSuccess and $stateChangeStart
I am trying to do some authentication with AngularUI Router. $urlRouter.sync() looks like exactly what I need. However, that's only available when I intercept $locationChangeSuccess. But when I do ...
0
votes
0answers
15 views
UI-Router: get a reference to the scope that is going to dissapear in updateView?
All the events related with UI-Router ($stateChangeStart, $stateChangeSuccess, $viewContentLoading...) seems to be broadcasted from $rootScope but one, $viewContentLoaded that is emitted from the ...
0
votes
2answers
48 views
Angular - UI Router - programmatically add states
Is there a way to programmatically add states to $stateProvider after module configuration, in e.g. service ?
To add more context to this question, I have a situation where I can go with two ...
0
votes
1answer
31 views
Highlight all active items in nested menu (AngularJS, ui-router)
I'm using AngularJS with ui-router for my website.
I have a multi-level menu (when you select one item, you can see next menu's level)
home | about | contact us
NY | LA | SF
Street1 | Street2 ...
0
votes
0answers
18 views
Multiple parents views with angular ui-router
I have a view, which is a child of 2 views.
I want to have different urls to restore it. (ex: #/activities/contact/12, #/search/contact/12 etc)
I haven't find a way to do that without duplicate the ...
0
votes
1answer
44 views
Angularjs ui-routing problems
I am working on SPA application using Angularjs and .NET web api, I am also using ui-route, and I have two problems there:
1. When I go to a traveldetail.html page, routing does go there but it ...
0
votes
0answers
30 views
AngularJS UI-Router Override $state.href How-To
Using AngularJS UI-Router
We're localizing all of our projects, including locale variable in the URL, and for some technical reasons we don't need to include it in state's URL (since UI-Router ...
0
votes
0answers
7 views
Query server and access a value for use in ui router config
I am using ui-router for angularjs url routing. In the config, I need to set the .otherwise url based on certain current state on the server. For this I need to query the server. How can I do that. ...
0
votes
0answers
22 views
Angularjs: Handling Failed Authentication from the API
I use angularjs in my new project. I want handling authentication in angularjs. I show app.js below:
app.js:
angular.module('app', ['ngAnimate', 'ui.router', 'sessionService'])
.config(function ...
0
votes
1answer
41 views
How to conditionally render CSS and JavaScript inside head element of an HTML
I need to use two different styles for two different looks of a page and I need different CSS and JavaScript files for that. Is there anyway I could conditionally render CSS and JavaScript files ...
0
votes
1answer
37 views
Angular renders the main view twice instead of loading the correct template
I'm having a problem with Angular templating - instead of including the correct template, the main view (view that initially gets loaded) is renderend twice. After spending the most of the last 2 days ...
0
votes
0answers
35 views
How to handle routing in MEAN application for multiple pages
I want to access my admin end using the URL http://localhost:3000/users/123 for which I have the following routing using Angular UI-Router module:
.state('users', {
url: '/users/:id',
views: ...
0
votes
0answers
18 views
How to create mutiple single-page-app like behavior in an app using AngularJS nodejs and expressjs
I am working on an application that has a front end and an admin end. The look of the admin end is different than the front end, that is the CSS and JavaScript files being used on front end and admin ...
1
vote
1answer
27 views
ionic how to add blank page as home page of the app?
I would like to add new page into default ionic app with tabbed menu and display this page as the default page of the app.
Here is how I tried to do that:
I added new state into app.js
...
1
vote
1answer
25 views
AngularJS with ui-router and additional state on first request
I am writing an AngularJS Application using ui-router. The states 'home' and 'book' are loaded into the (parent) - ui-view element
My setup for the routes is as following :
.config(function ...
3
votes
2answers
48 views
What is the benefit of using multiple modules in angular?
I'm a familiar person with Angular Js, recently I've seen that in some projects multiple angular modules are created and assembled in main module.
The code looks like.
...
0
votes
1answer
60 views
How can I persist sibling ui-views when changing state?
I have 2 ui-view directives in my application. One contains subnavigation and the other is the actual page content. My subnavigation is a tree structure, and when you click on an end node (or a leaf) ...
0
votes
2answers
15 views
Accessing scoped value from a Root Controller in AngularJS with UI Router
I have a simple requirement in which I need to display the value of $scope.resAVal on my index.html page. I have $scope.resAVal available in the RootCtrl.
index.html
<!DOCTYPE html>
<html ...
1
vote
2answers
36 views
UI-router issue with transitionTo
I am trying to use a route with variable parameters, that way I can use the parameters to check to which state to resolve.
I have made a simplified plunker which demonstrates what I am trying to do.
...
0
votes
0answers
19 views
ui-router prevent individual views from rendering
I wish to develop a dashboard which has multiple named views. Depending on the users role, I would like to prevent certain views from rendering (not simply hiding). With the release of 0.2.11, they ...
0
votes
1answer
21 views
UI-Router url regex for reserved AND dynamic url's
I want to have pretty url's for user profiles i.e. url.com/username
But also have reserved url's, such as url.com/categories, url.com/login etc.
I have states setup for the reserved url's e.g.
...
1
vote
2answers
54 views
How to Defer a StateChangeStart event until after a ui-router resolve executes
I have an angular app that uses authorization logic and ui-router to bar unauthorized users for certain states/views. I follow the standard approach of listening for a stateChange event, which ...
0
votes
1answer
29 views
Nested view template not loading
I am trying to create a tabbed interface that preserves state using AngularJS, UI Router and UI Router Extras and based on this example.
It works fine if I don't use a nested view with an abstract ...
0
votes
2answers
19 views
Resolve not returning vlaue to controller if in separate file/module
FILE [myapp.js]
$stateProvider.state('view6', {
resolve: {simpleObj: function(){ return {'value':"hello"}; }}
controller:'MyCtrl6'
});
Fails to pass resolved dependency to ...
1
vote
1answer
56 views
How to get ui-sref working on JQuery loaded html dom
I am new to Angular JS. What I am doing is to bind ui-sref on JQuery loaded data.
All the JQuery plugins and rest of Angular is working perfectly. What I have for now is looks like:
...
0
votes
0answers
13 views
Unexpected token when refreshing page using Html5Mode
I'm using Html5Mode(true) in my AngularJS app. This works fine when I browse to my website like this:
http://www.example.com
This then gets transformed to:
http://www.example.com/home/index
And ...
0
votes
0answers
41 views
AngularJs: How to recognize the name of a state which is already using controller?
I got reusable controllers and templates for views, and data service url/name depends on current state. I got 2 states : parent state and child state. When I'm in parent state i can make request to ...
0
votes
0answers
19 views
Angular ui-router and ng-grid - very laggy when switching between the pages/views :(
I'm trying to build a single page application using ng-grid and ui-router. All works fine, but when the user navigates between the tabs/pages there are some funny behaviours in the ng-grid tables. ...
1
vote
1answer
34 views
Matching url with array list of words in AngularJS ui-router
Using AngularJS + ui-router, I need to match a url with list of words:
However, using a regex I have tried using one or 2 words and it worked
url: '/{source:(?:John|Paul)}/:id'
But i need to ...
0
votes
2answers
19 views
Angular UI Router Set Scope/Variable
I have an Angular app using the Ui Router for routing purposes. Each time I change the router, I would like to change the header of the page, and it seems like the $stateProvider would be the easiest ...
0
votes
0answers
17 views
angularjs rails routing doesnt work
I'm having some problems when try to load angular views in my rails app. But if I do in the page `{{1+3}} it gives me the correct result as 4. So I believe its something to do with routes
Following ...
0
votes
0answers
26 views
How to create a state which can take optional parameter in angural-ui-router
Student administration application:
In one of my SPA , Admin is allowed to navigate into application only by selecting a “Student “ and studentID will be appended in “URL ”for further usage.
...