The built-in routing object in AngularJS, which can map the browser URL to a defined route.
0
votes
2answers
21 views
Angularjs route for node express js backend
I have creating a nodejs backend with an angular js front end. I have the following angularjs code for routing.
var myApp = angular.module('myApp ', ['ngRoute']);
myApp .config(['$routeProvider', ...
0
votes
1answer
26 views
angularjs routing without links
i have two problems.
first my test.html dont "see" the products array from his controller.
i dont know why, i have connect the controller with the html in the routing.config.js....
var myapp = ...
1
vote
3answers
2k views
Error Module when inject 'ui.router'
When I use the ui.router, I got the error message "Error Module" and it failed to instantiate module xPlat. In html file I use the angular-ui-router verson 0.2.11
below is my injection of ui.route :
...
0
votes
2answers
19 views
Dynamic dependency injection in Angular ui-router resolve
Is there any way to make dependency injection inside ui-router resolve function?
I trying to achieve something like this:
resolve : {
anArray : function(/* no dependencies yet */) {
var ...
0
votes
1answer
25 views
Routing issue root of parent
I have the following setup of my app:
@RouteConfig([
{path: '/', redirectTo: ['Login']},
{path: '/login', name: 'Login', component: LoginComponent},
{path: '/dashboard', name: ...
0
votes
2answers
45 views
Need to click 2 times to apply a class in angular
I have list menu items, and I want to add a class on click and remove the same class for other element. How ever clicking for the first time does not effect. But clicking again on the same item will ...
0
votes
0answers
39 views
Share data between pages with the same controller automatically - Angular JS
I am working with Ionic framework.
I've got two templates both of which use the same "ListController" controller:
1) A list of products.
2) A detailed view of a specific product.
Both templates ...
96
votes
5answers
69k views
Can angularjs routes have optional parameter values?
Can I set a route with optional params (same template and controller, but some params should be ignored if they don't exist?
So instead of writing the following two rules, have only one?
...
0
votes
0answers
12 views
Integration of Angularjs route into Zend framework
Below is my angularjs route code:
'use strict';
/* App Module */
var sApp = angular.module('sApp', [
'ngRoute',
'sAppControllers',
'sAppServices','swipeLi'
]);
sApp.config(['$routeProvider',
...
1
vote
2answers
834 views
AngularJS UI-Router event when changing route
Using ngRoute once can hook up in event: $routeChangeStart and do different actions ...
app.run(function ($rootScope, $location) {
$rootScope.$on("$routeChangeStart", function (event, next, ...
0
votes
1answer
39 views
angularjs how to route 2 seperate controllers on 2 seperate pages for same module
I have a main page which has a module, the routing, a factory, and a controller. Below is the first page and after that I've pasted in the second page.
var myApp = angular.module('myApp', ...
0
votes
1answer
20 views
AngularJS ui-routing project - from https://angular-ui.github.io/ui-router/#resources
I'm trying to make a sample app using AngularJS ui-routing.
I'm using a tutorial from here: https://angular-ui.github.io/ui-router/#resources
I'm getting errors in the console when I run the site ...
143
votes
12answers
40k 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
1answer
29 views
Bootstrap tabs aren't working with AngularJS routes. 'data-target' isn't working too
I got this code from the Bootswatch website, it supposed to work just fine :
<ul class="nav nav-tabs">
<li class="active"><a href="#home" data-toggle="tab" ...
0
votes
2answers
51 views
How do I access Javascript elements within my Angular ng-view using $routeProvider?
I am creating an Bootstrap/Angular app and using $routeProvider to render the views, and want to have tabs within one of those views. However, the active tab Bootstrap functionality isn't toggling. ...
2
votes
2answers
54 views
How to inject $httpParamSerializer for use in templateUrl
I am trying to inject $httpParamSerializer for use in templateUrl but I am having some issues. There isn't any good documentation and examples of how to use $httpParamSerializer.
Example code:
...
0
votes
2answers
30 views
Sending routeparams with the URL on form submit
I need to send route params with the URL when the user clicks on submit button.
Here is my simple form
<form action="#/chat/{{username}}">
<input type="text" placeholder="enter a ...
4
votes
2answers
2k views
Angularjs + Typescript, How to use $routeParams with IRouteParamsService
I am using the $routeParams to pull in properties from the URI and set local vars to them.
When I use typescripts typing to set the type of $routeParams, I can no loger access the $routeParams.
...
3
votes
2answers
391 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 ...
1
vote
1answer
23 views
Calling controller from function and passing it a URL-encoded parameter
I am developing a CRUD interface for a Rest service. Currently, I could manage to get the list of teams in the system.
What I like to do is to show details for the when I click the show link. ...
0
votes
0answers
24 views
Angularjs routing for multiple Asp.Net MVC controllers with POST form request
I have 3 Asp.Net MVC controllers and all have one Index view. I am trying to do angularjs routing for the actions. Assuming the urls are like
http://localhost/Budget/Index (default controller)
...
0
votes
2answers
32 views
Ionic Framework Routing Issues
I am creating an App in ionic but I am stuck in routing issues. Currently I have an app view with a side menu and on Home page I have two tabs Tab 1 and Tab 2 which have different UI Views tab1.html ...
0
votes
1answer
41 views
Angularjs route not calling the corresponding route's controller/view
I have an Angulrjs application and in the app.js I have the following config like below:
.config(function ($routeProvider, $locationProvider, $httpProvider) {
$routeProvider
...
1
vote
1answer
36 views
Angular UI Router ui-sref nesting
Currently building an online shop in angular. Structure is as follows
Store page - Category - Product
.state('shop', {
url: '/shop'
.state('shop.category', {
url: '/:slug'
...
0
votes
1answer
67 views
angularjs state.go not working
I'm trying to load a form on success of a delete request as follows
$scope.delete = function (id) {
if (confirm("Are you sure you want to delete this record?")) {
var url = ...
1
vote
2answers
26 views
$resolve not added to $scope until after controller creation
I'm trying to take advantage of the (new in 1.5.0) feature that adds the resolve map to the scope of the route. However, it seems like the map isn't actually getting added to the scope until after ...
0
votes
1answer
24 views
angularjs: getting route resolved data outside template
On loading '/', I am getting 'content' and 'sidebar'using 'myService' and resolve option in route provider and I can render the 'content' to the template ($scope.contents = content;).
But ...
0
votes
0answers
20 views
Error: Could not resolve 'project.projectview.details' from state 'project' when accessing state of child module
I have a parent module called 'projects' and a child module called 'projects.projectview'.
projects module
(function () {
'use strict';
angular
.module('projects')
.config(configs);
...
0
votes
2answers
26 views
How to navigate through views without changing the url?
Using angular 1.5, I'm developing some features and views, where I pretend to perform some navigation, keeping the url untouchable
example:
1) Access to url myapp.com, shows login form
2) login ...
0
votes
2answers
65 views
Unknown provider error - AngularJS App issue
var myApp = angular.module("MyApp", ['ngRoute']);
myApp.config(['$routeProvider',
function($routeProvider) {
$routeProvider.
when('/', {
templateUrl: 'partials/cart.php',
...
0
votes
0answers
25 views
AngularJS splitting routes results in module is not available
I'm using AngularJS 1.3 on a large single page app and I'm trying to split up my routes file.
I'm following the advice from the following question and have run into problems finding my new module
How ...
5
votes
2answers
2k views
Blank page using multiple views with UI-Router
I followed this article and this other I've tried to replicate what's on the wiki, without any luck.
So far this is what I've done
the folder structure:
partial
index
index.html // inner view
...
10
votes
2answers
878 views
IE favicon disappeared when navigating other page in angular application
I found an issue with angular application.
I have a the location provider setup to use the html5Mode true:
$locationProvider.html5Mode(true);
I noticed that the favicon is disappearing when ...
0
votes
2answers
31 views
How to include my angular controller into my ui-router model
I am a newbie in angular. I want to include my controller lib/AppController.js into my ui-router module to display on the index page. Kindly help
here is my
index.html
<body>
<div ...
0
votes
1answer
27 views
Angularjs routeprovider.when for set of conditions and one controller
I have 3 urls(blog, help, tips) for routing which will be having same controller and same html page.
rcapp.config(function($routeProvider) {
$routeProvider
.when('/csv-validation',{
...
0
votes
3answers
35 views
How does Angularjs routing work for applications outside the browser?
I am creating a single page app (mobile/desktop) using AngularJS. Based on the limited knowledge I have of AngularJS, I think the routing for the apps/websites is based on urls and ...
3
votes
2answers
2k views
AngularJS: how to preventDefault() of an event after promise completes?
I have some code like this:
$scope.$on("$locationChangeStart", function(event, newPath, oldPath) {
// Do some sync checks
if (!$scope.isPageAllowed($location.path()))
{
// ...
0
votes
1answer
26 views
bootstrap component tabs, carousels etc not respond
Until my contact page was a static HTML ie contact.html the bootstrap component tab, carousel etc work fine
as soon as I used ngRoute, routing to a partial view these components functionality no ...
0
votes
0answers
5 views
Design - nav that sending data
Iam building my first angular app and I have a design question that I'm racking my brain couple of days.
I got a nav and lists in the nav. Every li is sending data to a function in a controller that ...
1
vote
1answer
17 views
How can I construct an AngularJS state parameter in the view by concatenation?
Using the AngularJD ui-router, I have defined a state myState that takes 3 parameters: stateParam1, stateParam2 and stateParam3.
In my view the variables var1 and var2 are already defined. I pass ...
0
votes
1answer
55 views
angularjs and brackets live preview: The simplest code doesn't work
I'm a newbie to angularJS and I'm trying to make the simple thing to work but I fail.
HTML:
<!DOCTYPE html>
<html>
<head>
<script ...
163
votes
5answers
182k views
Angular JS: How/when to use ng-click to call a route?
Suppose you are using routes:
// bootstrap
myApp.config(['$routeProvider', '$locationProvider', function ($routeProvider, $locationProvider) {
$routeProvider.when('/home', {
templateUrl: ...
528
votes
10answers
115k 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 ...
1
vote
2answers
27 views
Angular route provider not working
I have MVC application with angular. Iam using route provider that is working fine on debug mode but when Im setting my app on iis it's not working, the site url should be: ...
2
votes
1answer
261 views
How to keep query string parameters in URL when accessing a route of an Angular 2 app?
I have an Angular 2 test app running the latest alpha (37). There are just three routes, that look like this:
@RouteConfig([
{ path: '/', component: Home, as: 'home' },
{ path: '/errors', ...
70
votes
8answers
42k views
Angular - ui-router get previous state
Is there a way to get the previous state of the current state?
For example I would like to know what the previous state was before current state B (where previous state would have been state A).
I ...
47
votes
2answers
19k views
What is the difference between $routeProvider and $stateProvider in AngularJs
Please explain the difference between $routeProvider and $stateProvider in AngularJs.
Which is best practice.
33
votes
5answers
21k views
Is there a way to preload templates when using AngularJS routing?
After the Angular app is loaded I need some of the templates to be available offline.
Something like this would be ideal:
$routeProvider
.when('/p1', {
controller: controller1,
...
3
votes
1answer
48 views
Angularjs Client-Side Routing with ui-router
I use ui-router (states) for my routing:
$urlRouterProvider.otherwise('/Home');
$stateProvider
.state('home', {
url: '/Home',
templateUrl: '/Home/Home',
controller: ...
7
votes
1answer
3k views
File download links with angulars UI-Router
I'm trying to create a simple link in my angularJS app to files that have been uploaded. I have no problem producing the link, as this is pretty trivial. The issue I have however, is that the routing ...