Tagged Questions
0
votes
1answer
26 views
AngularJS redirect flashes previous template
This question has been asked a couple of times with no correct answer so hopefully this question/answer will resolve many peoples' issues.
Basically I have a resolve object attached to my routes, ...
1
vote
0answers
29 views
angularjs $routeProvider route is executed before resolve completes
I would like the route.resolve method(s) to fire before the actual route code is run. Unfortunately in the code below, prime() gets called but it is called asynchronously and the route code gets ...
0
votes
1answer
20 views
AngularJS $routeProvider does not have reload method
The AngularJS documentation indicates that the ngRoute $routeProvider has a reload method.
reload()
Causes $route service to reload the current route even if $location
hasn't changed.
As ...
-1
votes
1answer
61 views
Using resolve in $routeProvider causes 'Unknown provider …'(Solved)
SEE SOLUTION AT THE BOTTOM OF THIS POST
So I am trying to do an asynchronous http request to load some data before my app loads and so I am using a resolve in $routeProvider which is an http request ...
5
votes
1answer
55 views
AngularJS - use routeProvider “when” variables to construct templateUrl name?
So this is what I am trying to accomplish:
'use strict';
var app = angular.module('myModule', ['ngRoute']);
app.config(function($routeProvider) {
$routeProvider
.when('/', {
redirectTo: ...
0
votes
1answer
47 views
Back Arrow and Angular Routing - Press Back Twice
Angularv1.1.5
Site: http://tilsa.azurewebsites.net
I have a very simple route setup however when the user goes from the default/home route to the detail (pregunta) route and then clicks the back ...
-1
votes
1answer
44 views
Switching between views on same controller
I've got a page that says "GENERATE", and it has a form on it. And then you submit the form by pressing the Generate button, and I want it to take you to a new view called "LOADING" whilst it waits ...
0
votes
1answer
34 views
Stop a common template from being reloaded
I have an Angular application that depends on Angular ui-router. This application has multiple pages which share a common template such as the navbar:
var app = angular.module('app', ['ngSanitize', ...
0
votes
1answer
52 views
AngularJs - Dynamic Routes with Crud in 1 Controller
I am able to successfully utilize dynamic routes. I would also like NOT to separate CRUD functionality in my different controllers (ie. keep CRUD in one controller per object).
Per this question, I ...
0
votes
0answers
44 views
Subviews in Angular
So I am trying to render a subview within a template but I want to define the state inside of the subviews controller on click of an element. The reason for splitting it out from the main controller ...
0
votes
0answers
25 views
Make sure some object is loaded from server before $locationChangeStart event handler gets executed
I have a handler bound to $location's $locationChangeStart event. Within that even handler, some user object coming from the server is required. Below is the code (simplified) that I have:
...
0
votes
3answers
100 views
AngularJs Routing without hashtag in link?
I've recently began learning AngularJs for web development and am loving it so far. However, I'm not so sure about having hashtags withing the link when routing between views. My main concern is how ...
1
vote
1answer
42 views
Set angular.js url root globally
I have an angular app that is hosted at my university server.
Because the app is not in domain root (urls are constructed as follows: university.domain/~<student_id>) all links and image srcs ...
0
votes
0answers
38 views
getting Wrong url in Angular url [on hold]
I have getting a problem with Angular js url.i have implementing app.js where all url mapping is done.my proper url is this for page.html "https://chanrjeetsingh.com/home/index#/page.html".
but i ...
1
vote
1answer
71 views
AngularJS $location.path(path) not updating at first
I have a piece of code where I call $location.path(name) and nothing seems to happens (at first). I can call console.log($location.path()) and it does show the new path -- but the view doesn't change.
...
0
votes
2answers
50 views
How to replace a part of sections in ng-view?
I'm leaning Angular's route. It's very clear how to load a view into ng-view by simply setting template attribute.
Let's say I have a widget on a view. When a user navigate to /#/changeWidget, how do ...
-1
votes
1answer
60 views
How to handle “complex” logic in route.resolve in AngularJS
Currently in some of my controllers I have a logic that e.g. redirects user to a different route if some conditions are met.
I'm trying to move some of this logic from controllers to route.resolve to ...
2
votes
1answer
51 views
How to change URL not not trigger $route changes?
I have a situation where I want the URL in the address bar to change, but I don't want Angular to refresh the controller or view like in a normal route change.
So, going to /data then clicking on a ...
2
votes
1answer
75 views
How to use native anchor links with angularjs
I'm using angularjs on a rather large flat documentation page. The page has some navigation thats designed to use traditional url hash links. The urls look like so:
...
1
vote
1answer
43 views
How to cleanly specify a resolve property for a route
I want to find a clean way to set resolve for a route.
From what I've seen there's 3 main ways of doing this:
declaring global functions (not good)
anonymous functions (bad if the logic is ...
0
votes
0answers
106 views
How do I execute foundation js call after images are loaded in AngularJS ngview?
I'm creating a web application with AngularJS and Foundation.
The problem arises when I use the Orbit content slider packed with Foundation. It requires a call to foundation's initializing function ...
0
votes
1answer
82 views
AngularJS Scroll to element prevent browser from jumping
I've written an app that has a list of blocks.
Each block contains links to other blocks.
When a link to a block is clicked e.g #/home/page-19, the page animates down/up depending on current ...
0
votes
1answer
98 views
AngularJS Scroll to ID using routeParams
I'm making a single page app, that has subpages.
The idea is, I have urls e.g home, about and contact.
Each page then has multiple blocks.
The blocks are set a minimum height, when page loads. The ...
0
votes
1answer
200 views
AngularJS and PhoneGap: $location.path causes subsequent tempateUrl lookup to fail
I'm having trouble getting path lookup to work with a AngularJS v1.2.0 and PhoneGap/Cordova Android application. I've come pretty far with html5mode(true) by setting <base href="."/> in ...
0
votes
1answer
52 views
routes in AngularJS and Angular versions
angular.module('appPTracker', ['ui.bootstrap',
'appPTracker.filters',
'appPTracker.services',
'appPTracker.directives',
'appPTracker.controllers',
'ngGrid']).
config(["$routeProvider", ...
1
vote
2answers
113 views
Add “intermediary” page prior to full page load Angular
My problem
I am using Angular to create a Phonegap application. Most of my pages are fairly small and the transition/responsiveness is quick and smooth. However I have one page that is fairly large ...
1
vote
2answers
377 views
Redirect from Angular JS not working for URL with hash '#'
Background of how I am initializing my AngularJS app is here :
SCRIPT5022: 10 $digest() iterations reached. Aborting! and redirecting to index.html
Summery Problem
When I do a window.location = ...
0
votes
1answer
37 views
Angular app routeProvider confused in app mounted on sup path
My single page app is not mounted on the root, so the path to the app is something like http://…/sub/. I took care of the base by adding this to the HTML file:
<base href="/sub/"/>
My ...
1
vote
2answers
79 views
Routing issue b/w angularjs and expressjs
Express.js routing of /question/ask
app.get('/question/ask', function (req, res){
console.log('index.js');
console.log('came to question/:id');
res.render('app');
});
The corresponding ...
2
votes
1answer
1k views
Cross origin requests are only supported for HTTP
I'm trying run this code:
<!DOCTYPE html>
<html ng-app="myApp">
<head>
<title>Exemple 06</title>
</head>
<body>
<!-- Diretiva ng-repeat -->
...
0
votes
1answer
96 views
routing bug in an angularjs app with jQuery
I'm trying to get set up an angularJS app with jQuery and I'm using the angular routing system for urls doing something like the following:
var app = angular.module('app', []);
...
0
votes
1answer
95 views
Angular: How can I use different templates for different views?
I've got an AngularJS site. The index.html used to look something like this:
...
<div class="layout stuff headers whatever">My awesome header layout</div>
<div class="container" ...
0
votes
1answer
370 views
AngularJS redirect a route only on browser's back button
In my AngularJS application I'm redirecting the route to a specific page when the user isn't logged. To do that I'm using a variable on $rootScope.
Now I would like to prevent the browser's back ...
0
votes
1answer
130 views
Angularjs: How to create a optional route map param?
On AngularJS 1.1.5, I've got two mapped routes in the form:
/category/:name/:article
/category/:name
I'd like to only have the latest, and route the param :article to a action. This action is ...
0
votes
0answers
72 views
routingProvide not found AngularJs
I am just trying to learn Angular.Js and got stuck here watching a tutorial.
I just created a demo App with the following code ... and I am getting an the following error. Any help would be greatly ...
1
vote
2answers
67 views
How to globally resolve a dependency (preload current user from server)
I know I can resolve certain dependencies for a controller based on the route. However, I have a service that I always want to be resolved: The current user.
The service basically does a get request ...
2
votes
1answer
132 views
AngularJS How to get additional routes parameter
Is there a way to add extra parameters to the $routeProvider and retrieve this parameters in a directive? I need this because the variable is page specific.
I would like to add a parameter pageName ...
1
vote
3answers
82 views
In Angular, is there a way to call code when $routeProvider.otherwise is fired?
I know there is no catchall controller for Angular. E.g.:
$routeProvider.otherwise({
controller: 'CatchAllCtrl'
});
However, is there a way to call some code if $routeProvider.otherwise is ...
0
votes
1answer
176 views
Do angular views work when a site is served from the local file system?
I'm using angular to develop an application. I'm developing off my local file system, on Windows. However, when I enable angular-route.js, whenever I hit index.html with my browser, it instead goes ...
0
votes
3answers
89 views
$location.path doesn't change in a factory with AngularJS
My factory looks like:
'use strict';
angular.module('myApp')
.factory('httpInterceptor',['$q','$location', '$rootScope', function($q, $location, $rootScope){
return {
response: ...
1
vote
0answers
100 views
AngularJS: remembering state/setup of complex views with routes
In a single page application, is there a way of switching back and forth to an AngularJS route and to display it back in the same state as it was shown before?
Usually this would be implemented by ...
0
votes
0answers
469 views
adding angularjs to spring mvc
i am trying to add angularjs to my spring 3.0 project. I am not able to add angularjs as front end technology for my project. here is my web.xml file.
<?xml version="1.0" encoding="UTF-8"?>
...
0
votes
1answer
67 views
Request url when html5Mode(true)
I have enabled $locationProvider.html5Mode(true).
However I have django as backend. On /logout/ I need to ask the url directly to the server as if $locationProvider.html5Mode(false) or simply ...
0
votes
1answer
118 views
AngularJS. ui-view included in ng-view
I try to use ui-view included in ng-view, and it does not work. But when I use ui-view near ng-view, ui-view work and in ng-view.
Don't work:
<div ng-view id="body-div"></div>
Work:
...
0
votes
1answer
264 views
Angularjs routing and html5
I have some routes for my application:
$routeProvider.
when('/user', {templateUrl: 'user/partials/userlist.html', controller: 'userListController'}).
...
0
votes
2answers
147 views
ngClick on anchor tags causing problems in Angular
I've got ngClick directives on the anchors tags inside my main navigation, to make the menu "disappear" off canvas after clicking it:
<a href="/#/profile" ng-click="showNav = false">
It's ...
1
vote
1answer
2k views
AngularJS 1.2.0: Lazy load controllers and templates
I am newbie to AngularJS. I am using the following code to achieve the lazy load dependency.
https://github.com/matys84pl/angularjs-requirejs-lazy-controllers/
This was working great with 1.0.7, ...
0
votes
1answer
84 views
How to pass objects into angular.js directives? Interpolated argument appears to be serialised
I'm trying to pass a JavaScript object into an angular directive. I'm invoking it like this:
<thing-badge thing="{{thing}}"></thing>
The directive looks something like this:
...
0
votes
1answer
66 views
Angular routing with a star doesn't seem to work
The angular docs say:
path can contain named groups starting with a colon (:name). All
characters up to the next slash are matched and stored in $routeParams
under the given name when the ...
0
votes
0answers
111 views
Dynamic routing with dynamic controllers in AngularJS
I am currently using require.js and angular. Since I have a very long list of custom views, each for a different task, I've cooked up a way of including them dynamically using requirejs.
First a ...