Questions tagged [angularjs-routing]

Use for ngRoute, the built-in routing module in AngularJS, which can map the browser URL to a defined route.

Is used for deep-linking URLs to controllers and views (HTML partials).
It watches $location.url() and tries to map the path to an existing route definition.

Routes can be defined through the $routeProvider API. The $route service is typically used in conjunction with ngView directive and the $routeParams service.

See:

Related tags

1283 questions
0
votes
2 answers

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'); var name = req.params.name; …
Sangram Singh
  • 7,161
  • 15
  • 50
  • 79
0
votes
1 answer

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' }). otherwise({redirectTo:…
Sangram Singh
  • 7,161
  • 15
  • 50
  • 79
0
votes
1 answer

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: $locationProvider.html5Mode(true); I must make this because I need keep the…
aloon
  • 403
  • 7
  • 17
0
votes
1 answer

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 receives the webpage, it sees the route. I need…
lostpacket
  • 1,383
  • 8
  • 26
  • 38
0
votes
2 answers

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 required route segments, so that /:locale would…
szimek
  • 6,404
  • 5
  • 32
  • 36
0
votes
1 answer

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'; var validPage = true; $.ajax({ …
Zuriel
  • 1,848
  • 1
  • 19
  • 32
0
votes
1 answer

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:
0
votes
2 answers

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 update and updates the database. If you then…
Andrew Boes
  • 2,013
  • 4
  • 22
  • 29
0
votes
1 answer

angularjs - After changing views using routing the jquery elements doesn`t get rendered

My issue is that after changing views using routing, the jquery components in my page doesn´t get rendered. I have customized ui components like dropdowns that are not being processed. I saw this answer: Angular.js App with routing.. Cannot get…
Guillermo
  • 1,493
  • 3
  • 16
  • 35
0
votes
1 answer

angularjs $routeProvider does not include views (unknow provider)

I'm having trouble finding out why ngRouts doesn't include the views i have set. When i look at the javascript console i do get the following error. Error: unknown provider. I looked that up and came to posts about not using the angular-route.js…
0
votes
1 answer

angularjs $routeProvider - route not found

I am using angularjs with requirejs. I am running into a problem where my routes are not being routed properly. It's constantly routing to /. If I change /post to /:post it hits my post route. // module/post.js define([], function () { 'use…
slik
  • 5,001
  • 6
  • 34
  • 40
0
votes
2 answers

Angular: 1.2.0-rc1: Href='#collapse1' now wants to change the physical route and $routeChangeStart fires

I updated angularjs to 1.2.0-rc1 and added in ng-route as a dependency and added the angular-route.js file. In this build it is now separate. Clicking on a link for example that has a bookmark href assigned which i used for bootstrap.. …
Martin
  • 23,844
  • 55
  • 201
  • 327
0
votes
2 answers

angularjs routing conflict with jquery functions

I'm having a problem with angular routing mechanism: $routeProvider .when("/", { templateUrl: "/*some MVC calls to return a partial view*/"}) .when("/somewhere/:someParams", { templateUrl: "/*some MVC calls to return a partial view*/"}) ... …
0
votes
1 answer

Angularjs, remove # from url in IE

I have following problem. On client side I have angular routing, something like that: ... $locationProvider.html5Mode(true); $routeProvider. when('/item/:item_id', { reloadOnSearch: false, templateUrl: '/views/main/partials/_item.html',…
IgorCh
  • 2,641
  • 5
  • 22
  • 29
0
votes
1 answer

$state does not transition to defined state in unit test

I have service that uses $state. I am trying to unit test the service. I see that $state.current does not change after call of $state.transitionTo. I checked $stateProvider, it contains states. Routes config: angular.module('EmsWeb.Routes',…