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

How to set a model for a single view in Angular JS?

I've got a controller in Angular JS. In this controller i've got a $scope.users property : it's an array of users. This controller is used by two views: /users and /users/:id. I've seen that the $scope.users models is init each time i come to an…
Thomas Pons
  • 7,709
  • 3
  • 37
  • 55
0
votes
1 answer

Changing sort order of ng-repeat changes routeParams.id

If I leave the sort order unchanged, using routeParams.id to pull the correct object from my scope.data object works like a charm. As soon as the order changes, the routeParams.id changes and doesn't match up with the order of objects within…
iamsar
  • 1,080
  • 2
  • 15
  • 28
0
votes
2 answers

Issue when page reload

My problem is simple, i am on a page of my app, and when i hit reload / refresh button in the browser, instead of load the same page, it fallback to /home, the strange thing is that at the first moment it try to reload the page, but something happen…
Tolke
  • 198
  • 1
  • 14
0
votes
2 answers

How can we add a template to a div in angularjs

i am stuck in some concepts of backbone which i try to implement in angular js . in backbonejs we can add a template (html page) to a particular div tag and we can render that div itself. is possible to do same in angularjs? adding a template to…
Jose G Varanam
  • 767
  • 8
  • 19
0
votes
0 answers

Back to previous page with browser back button, OK - back with plain JavaScript, Not OK

In my website I have a products page and when you click on a product, it goes to the details of the product. The link of the product page is: http://www.dummyurl.com/Index.html#/category/1/Foam?price=13.13-26.25&color=Green The link of the product…
Renzzs
  • 1,046
  • 2
  • 11
  • 20
0
votes
1 answer

Multiple Controllers, only ng-view affected

I have a page which uses two controllers, SearchController and ProductController, that are both part of one app. They both sit on the main page, and are called using ng-controller. I have a route set up for when i click 'search' and this loads an…
mnsr
  • 12,337
  • 4
  • 53
  • 79
0
votes
1 answer

angularjs: checking url location change

I'm watching the $locationChangeSuccess event. I need a clean way to check whether the URL has changed or if only the parameters have changed. I could compare the 'next' and 'current' parameters, but maybe there's a function doing that already ?
Sam
  • 13,934
  • 26
  • 108
  • 194
0
votes
1 answer

angularjs routing captures anchor elements of superfish menu

I'm trying to use angularjs with routing in combination with superfish menu. My web application is a MVC application and I use the superfish menu to navigate inside my web application. The superfish menu contains links that allows me to navigate to…
rekna
  • 5,313
  • 7
  • 45
  • 54
0
votes
1 answer

How do I make angular-ui bootstrap accordion group work in html5mode

If I enable html5mode to true in my config module, the "hyperlink" that opens the accordion-group reroutes the url back to the base url. Not only does the accordion group not open, but you are rerouted. I had the accordion-group working fine when…
rGil
  • 3,719
  • 1
  • 22
  • 30
0
votes
1 answer

AngularJS: pop up dialog from a route?

I have an admin CRUD interface utilizing AngularJS. Everything is fine except one problem: I want to have a pop up dialog for editing/creating item and I can't make route to don't replace the whole ng-view. How its done and is it possible? If not…
Daniel
  • 4,272
  • 8
  • 35
  • 48
0
votes
0 answers

How can i get http configs in angularjs routes?

I want to get configs (for example, url) sent in http request in my routes. Here is my route : angular.module('myApp', ['myApp.directives', 'myApp.services', 'myApp.filters']).config( function($routeProvider, $locationProvider,…
Amb
  • 3,343
  • 7
  • 27
  • 34
0
votes
1 answer

$location does not navigate on first ng-click callback

Something weird is going on in my AngularJS application. I have a view which has a list of anchor tags bound to an array of objects (I'm using ng-repeat to render the list). Each one of the anchor tag has an ng-click bound to a method on the…
Kassem
  • 8,116
  • 17
  • 75
  • 116
0
votes
2 answers

Send query params to server from angularjs routes

I am using AngularJS for my client side framework. Using the routeprovider, I want to sent query params to my templateURL for processing. Basically my templateURL is a server side php script which will generate HTML. Now routeprovider is not…
Naveen
  • 1,067
  • 2
  • 14
  • 36
-1
votes
1 answer

Angularjs routing not working at all

I am attempting to route my app with angular js routing however it is not working. When I click the link nothing happens. My html:
user7951676
  • 377
  • 2
  • 10
-1
votes
3 answers

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 /news/:id/, i am getting jquery/angular errors in…