Tagged Questions
0
votes
2answers
36 views
Routing does not work in angularjs
I am very new to angular js.
I have implemented routing in angular js but it does not redirect me to the pages I have stated in the route.js
here is the code:
Route.js
var sampleApp = ...
0
votes
1answer
40 views
ng-view is not working, asp.net
my zAngular file:
angular.module('Portfolio', ['ngRoute', 'ngResource'])
.config(function ($routeProvider) {
$routeProvider.when('/Home/Portfolio', { templateUrl: 'templates/Portfolio.html', ...
0
votes
1answer
25 views
how can i add js with ng-view and execute immediately angularjs
for e.g
in my angular app
app.config(function($routeProvider, $locationProvider) {
$locationProvider.hashPrefix('!');
$routeProvider.when('/login', {
templateUrl: '../login',
...
0
votes
2answers
229 views
Running deployd and angular.js app on the same server
I'm trying to run a deployd API on the same server as my AngularJS app, but deployd seems to be conflicting with the app routing.
My deployd server is listening on port 5000 and looks like this:
var ...
0
votes
1answer
18 views
Angular navigation gives 'bad request' on getting template
I'm trying to add routing to my new application where i'm for the first time using Angular.
I have the files or file fragments as described below.
app.js
'use strict';
var app = ...
1
vote
2answers
50 views
Routing error in AngularJS
What's wrong with this AngularJS configuration code?
(function () {
var ip = 'x.x.x.x';
var app = angular.module('cmal', ['controllers', 'directives', 'services', 'ngRoute'])
...
0
votes
4answers
82 views
Angular JS - Route to Non Single Page SPA
We need to load some pages in non SPA mode, while others in SPA mode. For example, homepage and about pages should be non SPA, while other pages should be SPA.
$locationProvider.html5Mode(true); ...
0
votes
1answer
21 views
AngularJS routing - won't load view
I have been attempting to follow several different online tutorials, but keep keep failing on the same thing: getting AngularJS to load a HTML template file into the ng-view section in my page.
I ...
1
vote
1answer
31 views
Angularjs intercepting routes of the backbone app
We are slowly transitioning to AngularJS from Backbone feature by feature. The problem is that angularjs intercepts all the route changes and doesn't let backbone listen to route changes.
Is there a ...
0
votes
0answers
15 views
Routing in Angular JS with Multiple Slashes (1.2.x)
I have injected ngRoute into my angular app, and routing works when paths are only one level deep, ie. only have a single slash.
in app.js:
app.config(['$routeProvider', function($routeProvider) {
...
0
votes
1answer
16 views
Angular Partials: templateUrl Routing Local .HTML File
I've had this problem for over 2 days and I've spent around 10 hours researching, but NOTHING has worked so far. I'm keeping my stress levels in check, but this is downright infuriating!
This ...
0
votes
1answer
25 views
How to preset a ui.router $stateParam
I have a dashboard with two or more views and links to load those views, on view one you can select a customer, once the customer is set selecting the link to go to view two should take the customerId ...
6
votes
4answers
9k views
Angular application config “Uncaught object” error (ngRoute)
I have this simple page:
<!doctype html>
<html>
<head >
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
...
1
vote
1answer
27 views
How to maintain the url for 404 page in angularjs
We're working on an angularjs app, in which the user is able to publish his or her profile as a resumée.
So for instance if the user has a published profile the following url is valid:
...
0
votes
0answers
34 views
How to use AngularJS HTML5 mode only for selected links?
I have a site that doesn't use AngularJS routing, but I want to use HTML5 mode for few links on page to load content using AJAX but also to update URL. Documentation says that I can specify target ...
0
votes
0answers
11 views
How to do a wildcard in a $resource definition, similar to $routeProvider?
So in my routeProvider I have
$routeProvider
.when('/widget/:wildcard*', {
templateUrl: '../../main/app/pages/widget/widget-page.tpl.html'
})
I then parse out ...
5
votes
2answers
4k views
Angular - different route, same template/controller,different loading method
I want to use routes, but I always want to use same template & controller. I have routes like this:
**a/:albumid**
and
**i/:imageid**
In the first case I want to load an array of images and ...
0
votes
0answers
26 views
Use of ng-include with ng-view causes erratic behavior on route change
I have an angular app running inside a rails app. I have included a catchall route to avoid 404 errors on page reload:
match '*path' => "popcorn#index", :via => [:get, :post]
My application ...
0
votes
0answers
24 views
Is building up a location string manually and then parsing it the correct way to work with $location in Angular?
I am currently using $location to do some routing for a SPA.
The way I am doing this currently is something like the following:
$scope.updateRoute = function () {
if ($scope.currentTabName === ...
-1
votes
1answer
41 views
AngularJS RouteProvider and ExpressJS sendfile
In my Angular app, I'm trying to render partials that load into the index page when a user clicks a link. It worked fine before with the following code:
//app.js in Angular
angular.module('myApp', [
...
0
votes
1answer
39 views
$http.get return root page angular & laravel
I have this angular code
var loginApp = angular.module('login', []);
loginApp.controller('loginCtrl', function($scope, $http)
{
$scope.password = "";
$scope.email = "";
$scope.doLogin = ...
0
votes
0answers
40 views
Check privilegies in nested states
I've got problem, I do use angular ui-router for routing to check if user is logged in I have something like this:
$stateProvider.state('settings', {
abstract : true,
url : '/settings',
...
0
votes
1answer
37 views
ng-view isn't being populated with the template
Consider this plunker. I think I've set up everything correctly, but my templates aren't getting loaded into the div with the ng-view directive.
My routes are configured:
routes.forEach(function (r) ...
19
votes
6answers
36k views
AngularJS dynamic routing
I currently have an AngularJS application with routing built in.
It works and everything is ok.
My app.js file looks like this:
angular.module('myapp', ['myapp.filters', 'myapp.services', ...
1
vote
2answers
89 views
Routing in AngularJs not working
i am trying to implement routing in AngularJs but it is not working. Following is my code
<html lang="en" ng-app="phonecatApp">
<head>
<meta charset="utf-8">
<title>My ...
0
votes
1answer
100 views
Stalling $locationChangeStart / $routeChangeSuccess for ajax call response. Global addition of resolve
On each route change I need to check if the user is logged in or not. If not then, I need to redirect the user to the login page otherwise display the page.
I have a parent controller to ng-view :
...
0
votes
1answer
17 views
StateProvider generate template url dynamically - closure issue
I'm generating my url states from an enum object by enumerating through the enum and generating a state for each value in it.
Now I need to generate my template url with a combination of a routing ...
0
votes
1answer
20 views
Page refresh with AngularJs templates
I am using ngRoute to serve up templates in my app. So I will do something like this
$routeProvider.when('/', { templateUrl: '/templates/search.html', controller: 'SearchController' })
...
3
votes
1answer
98 views
Get Rails route URL in AngularJS route config
I'm trying to integrate Angular routing in a Rails application. To keep things DRY and to prevent problems if routes change as the application is developed, I'd like to prevent hard-coding the URL in ...
21
votes
2answers
10k views
Can angularjs routes have default parameter values?
Can I set a default value of a parameter of a route in angularjs ? Is there a way to have '/products/123' and '/products/' handled by the same route ?
I'm looking to refactor my existing code, which ...
0
votes
0answers
32 views
Online brochure with index menu not working in angularjs+turnjs
I'm developing online brochure using turnjs with index menu to enable me to jump to specific page. the application is under Angularjs framework.I managed to make a new directive to the brochure like ...
0
votes
1answer
36 views
Content doesn't update on route change
When I change route, from say /set/1 to /set/2, then it still shows the information from /set/1 until I manually refresh the page, I've tried adding $route.refresh to the ng-click of the links to ...
0
votes
0answers
112 views
Why is this AngularJS routing broken when html5mode is enabled?
I would like to use AngularJS routing. I am using AngularJS-seed-master as a start and routing works by default. However, it stopped working after I enabled html5mode. Below is the html code when ...
0
votes
1answer
38 views
CodeIgniter - Maintain complex URL routing
I want to maintain a complex URL structure while routing. I could not write routing for the following requirement.
If the URL comes with http://localhost/api/cals/func/id I want to route it to ...
0
votes
2answers
90 views
Passing global data / user data to routeProvider in Angular + express application
This might seem like a silly question.. but how do I pass req.user.username (for example) to all pages / globally after the user signs in with passport. This question can apply to any data I would ...
0
votes
1answer
114 views
Check for 401 then redirect Angularjs but only on certain routes
I've got a nice angular service that checks to see if a user is logged in by looking to see if the server returns a 401 error message. If it does, the user is redirected to a login page.
This works ...
0
votes
1answer
25 views
Route conditionally load jQuery
In my AngularJS app I have one route that depends on jquery and jquery ui. I want to avoid the extra 150 kb.
Is it possible to load jquery and jquery ui only for that particular route?
1
vote
1answer
109 views
prevent a direct access to files using AngularJs and Node.js / Express
Using Angular and Node.js / Express, is there a way to prevent a direct access to my partial .html files whilst still allowing the following route handling:
My Angular routes look like this:
...
0
votes
1answer
55 views
How do I get a traditional url structure in a single page application (NO hash-bang)?
I want to build a single page application with angular.js the only thing is i want a traditional url structure.
Example:
Before: www.example.com/#/index
After: www.example.com/index
...
0
votes
1answer
149 views
having troubles using stateparams with angularjs
nHello,
I am trying to use parameters in my router as follows :
my url call in my html file:
<a href="#/itemlist/{{hikelist.id}}">Edit</a>
And my router :
packApp
...
26
votes
4answers
38k views
AngularJS - Animate ng-view transitions
I have 2 html pages, welcome.html and login.html both of which are "inserted" into index.html dependending on the URL via an ngview attribute and router provider, as part of my AngularJS app.
An ...
1
vote
1answer
363 views
htaccess redirect for Angular routes
I have an angular application with several routes, such as:
site.com/
site.com/page
site.com/page/4
Using angular's html5 routing mode, these resolve correctly when you click links to them from ...
3
votes
4answers
3k views
AngularJS Restful Routing
I'm trying to structure my app using the Restful/Ruby convension /<resource>/[method]/[id]. How I've done it previously when using a server-side MVC framework like CodeIgniter was to dynamically ...
0
votes
0answers
396 views
My Angular/Node/Express app serves index.html instead of static assets in production mode - why?
I have an Angular/Node/Express webapp built on generator-angular-fullstack.
In development mode, the app works just fine. But in production mode, it serves index.html whenever static assets (images, ...
1
vote
1answer
716 views
ASP.NET MVC AngularJS SPA URL routing not resolving to correct view
I'm trying to get the URL routing to jump to the correct page/view in angular spa setup
I have an index page setup like:
<html data-ng-app="app">
<body>
<div>
<div ...
0
votes
0answers
133 views
Angularjs some routes slow to load
I am having a very bizarre situation that I can't seem to figure out. Here are my routes:
$routeProvider.when(/application1/:type, {
templateUrl: "application1/index.html"
})
...
1
vote
1answer
419 views
How to correct set root route in Rails 4 for AngularJS?
I have a troubles with integrating Rails routing with AngularJS.
When I go to "localhost:3000" in browser input, it redirect me to the "localhost:3000/#/auth/sign_in"
but 'sign_in' template not ...
5
votes
3answers
2k views
AngularJS routing hijacking non base URLs when page reload is expected
I'm building an AngularJS app that is not located in the root location domain.tld/blog. I have routing setup for everything on the /blog base. I included the base tag in the head of the page <base ...
0
votes
1answer
36 views
angularjs - routing with search parameters
Let's say my current location is /phones
I want to route to a different controller and generate a url like /phonedetails?brand=x&size=y&price=z
How can I set up the route and controller?
...
0
votes
1answer
58 views
I cannot seem to get routing to work for my controller using Angular.JS [closed]
My controller works when I use the ng-controller attribute to my template-less code, and with routing my template loads, but not the controller. I cannot seem to find what I missed.
Error message:
...