Tagged Questions
1
vote
1answer
17 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
30 views
getting Wrong url in Angular url
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 ...
0
votes
1answer
25 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
22 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
36 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
36 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
2answers
48 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
35 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
63 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
34 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
56 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
116 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
41 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
85 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
162 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
33 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
72 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 ...
0
votes
1answer
335 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
64 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
72 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
165 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
78 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
54 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
62 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
85 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
68 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
111 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
69 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
66 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
255 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
55 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
78 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
202 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
101 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
1k 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
59 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
59 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
93 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 ...
2
votes
1answer
382 views
How to check for the existence of a module without an error being raised?
In Angular 1.2, ngRoute is a separate module so you can use other community routers like ui.router instead.
I'm writing an open-source module that aims to work for multiple different router ...
0
votes
1answer
125 views
Google bar chart won't show up inside ng-view html partials
Given the code below which I copy-pasted from Google Charts, (I've just removed the html, head and body tags). This code performs really well if I simply add it inside my index.html page, the bar ...
0
votes
2answers
109 views
server-side changes for $locationProvider.html5Mode(true);
server code:
app.get('/', function(req, res){
console.log('executed "/"')
res.render('home');
});
app.get('/partials/:name', function (req, res) {
console.log('executed partials:name');
...
0
votes
1answer
81 views
How to get rid of `/#/` in url when using Angularjs?
using ng-view and
myApp.config(['$routeProvider', function($routeProvider) {
$routeProvider.
when('/', {
templateUrl: '/partials/home',
controller: 'homePage'
}).
...
0
votes
1answer
63 views
AngularJS route without slash
in AngularJS can I set up a style route like this:
http://www.mydomain.com/title-and-more-irrelevant-text-123456-category.html
where '123546' is an indentifier ?
with:
...
0
votes
1answer
167 views
IIS URL rewrite module with angularJS does not work
I have a single page webapp where any request that begins with request for e.g. http://localhost/appname/request* , the home page is sent back to the client using IIS URL rewrite module.
When Angular ...
1
vote
2answers
489 views
Force AngularJS to reload a route although option reloadOnSearch is set to false
In the route configuration of my AngularJS application most of the routes are defined with the option reloadOnSearch set to false as most of the time a page should not reload when search parameter ...
0
votes
2answers
71 views
Does AngularJS have required route segments?
I've got routing that looks like this:
.when "/:locale",
templateUrl: "/views/index.html"
...
.otherwise redirectTo: "/en"
The issue is that the first route also matches /. Is there a way to add ...
0
votes
1answer
68 views
getting data via $.ajax how can i do it the “angular” way. Does $http replace $.ajax
here is my code.
.state("dynamic", {
url: "/:name",
controller : 'AppHomeCtrl',
templateUrl: function (params){
var myURL = params.name + '.html';
...
0
votes
1answer
87 views
AngularJs routing issue
I have some problem with angularjs routing. My goal is to append different view depending on the path. I want to implement this using different ng-apps in one html document like this:
<body>
...
0
votes
2answers
115 views
AngularJS and IE9 page refresh issue
My single page angularjs application seems to work fine in IE9+ until you edit an object and reload the page. If you modify a field (change Name from "You" to "Me") then press save the server gets the ...
4
votes
2answers
260 views
AngularJS change route without pushing a history state
I'm working on an AngularJS app that has a catch all route (eg, .when('/:slug', {...)) which is necessary to support legacy url formats from a previous (non-angular) version of the app. The controller ...