The built-in routing object in AngularJS, which can map the browser URL to a defined route.

learn more… | top users | synonyms

0
votes
2answers
25 views

Cannot get ng-controller to work in angular app

I've just started learning web development on my own, and I've run into an issue where either my entire app or just a controller just won't cooperate. In prototype.js, I declare the app: var ...
2
votes
1answer
200 views

iis 404 error when removing hash tag from url angularjs app

I'm developing a single page app using angularJS(client) and mvc web api (server). I have two physical page first Login.html and second Index.html when user successfully log in redirects to Index....
0
votes
1answer
34 views

$route.routes prints URLs twice ,why?

i have created a basic app to learn angularJs routing. When i printed $routes.route to the browser console , this is what i saw : And this is my route configuration : almRequirement.config(...
1
vote
2answers
1k views

How to add dynamic prefix to AngularJS routes

What i what is make localized urls like: http://example.com/eng/somepath http://example.com/ger/somepath Let pretend that we always know user lang. angular.module('website', []) .constant('...
5
votes
4answers
25k views

locationChangeStart and preventing route change

I'm trying to create basic validation whether user can access some route or not. I had progress in that, but there's one thing that I can't figure out. I'm using $locationChangeStart to monitor route ...
8
votes
2answers
2k views

prevent re initialization of controller on $location.path()

I am working on a application where I have to insert a back navigation link to main page from details page. Controller for both views are different. I am using $location.path('/') to navigate back to ...
4
votes
1answer
28 views

AngularJS Codeigniter base_url path settings

I am creating a website with Codeigniter 3 and AngularJs. While delevolping i have faced some issues with base url in codeigniter. Im attaching an image file of my directory struture. In my ...
0
votes
3answers
26 views

AngularJS SPA is not working in Web Api project

I have created a web api project and after that i am going to create single page application but getting some error so i am posting my code below: My angularjs code: var app = angular.module('myApp',...
0
votes
0answers
26 views

AngularJS Routing redirects to 404 page

I have the following routing configuration: $locationProvider.html5Mode().enabled = true; config file: define(function (require) { "use strict"; return ['$stateProvider', '$...
2
votes
1answer
15 views

Override the parent url with child url in UI-router (Angular)

This is the configuration i'm using for my ui-router: .state('parent', { url: '/child1' controller: ParentController, abstract: true }) .state('parent.child1', { url: '' }) .state('...
-1
votes
2answers
60 views

Routing is not working with AngularJS

As a part of learning process, I am roaming around angular js routing concepts. For this, I created one inner folder inside app with two sample test html pages .. When i run the app it should load ...
1
vote
3answers
5k views

$stateProvider not loading pages as expected

I am trying to use $stateProvider for my url routing. I thought that if I use $stateProvider, then I don't need to use $routeProvider. Is this correct? I was able to get my url routing to work with $...
0
votes
2answers
20 views

Route does not work in angularJS

All the directories are setup perfectly but still routing doesn't work. Pages 'folder' contain two pages 'addOrder.html' and 'showOrder.html'. I also included file 'angular.min.js' but still no ...
0
votes
1answer
38 views

Angular js How to pass parameters to $location.path() and use this in $routeProvider for routing

On button click I have code to navigate. $s.onClick = function (pageObj) { $location.path('/Next'); } Here param pageObj is object containing link (ex: http://sample..), title and other key ...
0
votes
2answers
30 views

ui.router not showing the page [nested view]

I know this is a well asked question but may be my "googleing" skills are not good enough to get me what I want. So I have a page with ng-view that is the main index.html <div class="row" style="...
0
votes
0answers
8 views

Url loaded using routeprovider of angular js do not work at page reload with laravel

I am using angularjs frontend with laravel backend.When i click on link i can partially load some content. However when I am reloading the page, laravel shows a httpnotfoundexception error. I placed ...
669
votes
11answers
151k views

AngularJS : Difference between angular-route and angular-ui-router

I am new to AngularJS. I find Angular quite interesting and planning to use angular in my big apps. So I am in the process to find out the right modules to use. What is the difference between ngRoute ...
0
votes
0answers
19 views

Maintain State of the view and edit using angular route

I am trying to build and application where I'll be having 2 users 1 will be having view right and other one will be having View + Edit right. There are "n" no of feilds in each page so I am thinking ...
1
vote
1answer
27 views

use ui-sref only if the parameter is defined

Here is my following code: view: <div class="single-user" ui-sref-active="activeState" ui-sref="app.usersingle({id:item[0].id})"> <li class="userTicket">Total: {{item[0]....
0
votes
0answers
17 views

How to route to Angular 2 component from Angular 1 app?

So I have Angular 1 app. And I have Angular 2 component; let's say Heroes Dashboard, dashboard.component.ts from https://angular.io/docs/ts/latest/tutorial. In Angular 2 router specified as list of: ...
0
votes
1answer
28 views

AngularJS back/forward button update model/scope

I'm having an issue with AngularJS and URLS. When I press the back/forward buttons in the browser I want my models to update accordingly. As you can see from this page: http://www.networkwestmidlands....
2
votes
3answers
77 views

Multiple named views with dynamic routing in angularjs

Edit: Here is the complete code at Plunker. Though I can not c anything in execution but same code working at local. However gives a console error though It all works perfect. But due to :id in /...
34
votes
4answers
23k views

AngularJS and Handling 404 Errors

What is the best way to serve up proper 404's with an AngularJS app? A little background: I'm building an Angular app and have opted to use $locationProvider.html5Mode(true); because I want the ...
0
votes
1answer
27 views

change css class depending on location path via controller

Can someone help me on how I can switch the css class of an element based on the url path in the controller? I tried to attempt this with code below, when I change the path to 'user' the class does ...
1
vote
1answer
39 views

Routes in Angular Not working

Code <body ng-app="ngapp"> <h2>NG App</h2> <div> <ng-view></ng-view> </div> <script src="Scripts/angular.min.js"></script> <script>...
2
votes
1answer
31 views

Angularjs select controller and template dynamically

I want to make routes to access user profiles and pages which made by users like belows. http://example.com/username http://example.com/page_url This should identify in the routing process by ...
-1
votes
0answers
20 views

AngularJS Error routing to dashboard module

I am starting with some project in AngularJS and I have some problems with routing. The version of AngularJS is 1.3.15. After going to index page I should come to dashborad. I get error which is shown ...
1
vote
1answer
15 views

Issue with using the same template for different states on ui-router

I'm trying to use the same template for 2 different views. My set up is this $stateProvider.state('me', { url: '/me', templateUrl: 'partial/profile/profile.html', controller: '...
1
vote
3answers
121 views

AngularJS: injecting providers in .config function

I'm failing to inject a AngularJS Provider, called UserAgent inside a .config function but I'm getting this error: Uncaught Error: [$injector:modulerr] Failed to instantiate module app due to: Error: ...
186
votes
15answers
53k views

Changing route doesn't scroll to top in the new page

I've found some undesired, at least for me, behaviour when the route changes. In the step 11 of the tutorial http://angular.github.io/angular-phonecat/step-11/app/#/phones you can see the list of ...
0
votes
0answers
19 views

Passing Big Data between controllers with Angular Route Params

I'm building an ionic app. One page contains articles, and when a user clicks on the article they go to a page with the article. This is a snippet of my config for routing: .state('article_detail', ...
0
votes
1answer
55 views

angular-ui-router doesn't work

I doesn't manage to route using ui-router. It does work for me with ng-route, so I must have missed something basic. There is no error but I don't get any view. The following code does not work (...
5
votes
4answers
3k views

what is the purpose of use abstract state?

I am working on my tutorial AngularUI project. I read all about states, nested states and abstract states. The problem is that I can't understand why and when I should use abstract state?  
0
votes
1answer
22 views

How to determine path/route in AngularJS to indicate current view in menu

I'm writing a small AngularJS app that uses Bootstrap. I'm using Boostraps Nav component and I want to highlight the current page's menu item. I need to be able to determine the path/route associated ...
0
votes
0answers
19 views

What does it mean exactly when we say “Dynamic Routing” in AngularJS

I have been working with AngularJS for last few Months. I heard this term "Dynamic Routing" from one of my colleague. He explained me little bit but not clear. Could anyone please explain me? Any ...
1
vote
2answers
41 views

Why UI router if I can use directives?

Well, I have never used and never felt like that I should use the UI router. I was asked in one of the interviews about this and so felt like reading if I am missing something out as an AngularJs ...
0
votes
0answers
82 views

Unable to load / route to HTML page using router-outlet

I'm trying to route to a login page in my main page Main Page is : KMS.html which goes like this (skipping scripts and all ) <html> <body class="hold-transition skin-blue sidebar-mini"> ...
8
votes
4answers
7k views

Angular's “controllerAs” not working in routeProvider

I am trying to use the controllerAs property on a $routeProvider route without any success. Here is the sample code: var app = angular.module('app', ['ngRoute']); app.config(['$routeProvider', '$...
31
votes
6answers
14k 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 ...
3
votes
1answer
2k views

Implementing Dynamic Routing in Angular2 (Typescript) [duplicate]

RouteConfig class which can be used to decorate a component (@RouteConfig) with routing capabilities has certain route definitions defined for that component. Now, the catch is to have these route ...
5
votes
1answer
115 views

ios address bar triggered when angular ui router state changes

I am using Angular UI Router. Whenever I click on a link with ui-sref the address bar from ios mobile browser shows up. For example when I scroll down, the address bar hides and if I click on a link ...
0
votes
3answers
90 views

Angular ui-router shows old stale data after transition back to state

We have an ASP.NET MVC 5 application which uses ui-router AngularJS module. When we go back to a state that has already been loaded, it always shows the old data until we do a full page refresh. For ...
3
votes
3answers
187 views

How to handle page refresh in AngularJS using ui.router with ASP.NET MVC

We are creating a single-page ASP.NET MVC application which uses AngularJS ui.router for client-side routing. Currently, the back/forward buttons work as expected, but when the user clicks the ...
3
votes
1answer
28 views

AngularJs routeProvider error

I am facing problem with routeProvider, don't know why its not working. The problem is with the config function .Here's the code var mainApp = angular.module('mainApp', []); mainApp.config(['$...
0
votes
0answers
20 views

Route in uib-accordion post back to server

I am using MVC5 with Angularjs 1.5.5 and Angular.UI.Boostrap 1.3.3. I have a anchor tag inside a uib-accordion-heading. This link is defined on the Angular routing side. First problem I encounter ...
0
votes
1answer
67 views

ng-view not rendering in cshtml

I have an inquiry about the failure of ng-view to render a partial view in a cshtml page in a hybrid angularjs and asp.net mvc application. I have seen this work before, but cannot locate the cause of ...
0
votes
1answer
83 views

Angular 1.5 Component Routing from Server Side

I am looking to upgrade angular version to 1.5 and trying to figure out how I can do routing in Angular 1.5 Component Routing. Currently, we are doing as following using old angular router: myApp....
2
votes
1answer
2k views

Unknown provider: $routeParamsProvider <- $routeParams

I am currently learning AngularJS & Ionic by creating a simple podcast app. I am trying to use routeParams to get the "itemId" but I am getting the following error: Error: [$injector:unpr] ...
1
vote
1answer
105 views

How to single bind in ui-sref?

I am doing ng-repeat of a list that look like this: <div ng-repeat="x in myCtrl.data" ui-sref="app.detail({id: x.id})"> <img ng-src="{{::x.image}}"> <h2>{{::x.name | ...
2
votes
3answers
70 views

How to do $state.go() with params?

I have perfectly initialized $stateProvider and I'm using all this states with ui-sref. Works great. User presses the button and thorugh the $stateProvider goes to the edit page. On this page I ...