Skip to main content

Questions tagged [routes]

Questions about mapping URLs to Controllers and Actions.

680 votes
31 answers
756k views

How to detect a route change in Angular?

I am looking to detect a route change in my AppComponent. Thereafter I will check the global user token to see if the user is logged in so that I can redirect the user if the user is not logged in.
AngularM's user avatar
  • 16.5k
399 votes
31 answers
142k views

No route matches "/users/sign_out" devise rails 3

I've installed devise on my app and applied the following in my application.html.erb file: <div id="user_nav"> <% if user_signed_in? %> Signed in as <%= current_user.email %...
vich's user avatar
  • 11.9k
386 votes
10 answers
604k views

Send data through routing paths in Angular

Is there anyway to send data as parameter with router.navigate? I mean, something like this example, as you can see the route has a data parameter, but doing this it's not working: this.router....
Motomine's user avatar
  • 4,414
339 votes
18 answers
182k views

S3 Static Website Hosting Route All Paths to Index.html

I am using S3 to host a javascript app that will use HTML5 pushStates. The problem is if the user bookmarks any of the URLs, it will not resolve to anything. What I need is the ability to take all url ...
Mark Nutter's user avatar
  • 5,589
256 votes
9 answers
424k views

A potentially dangerous Request.Path value was detected from the client (*)

I am receiving the rather self explanatory error: A potentially dangerous Request.Path value was detected from the client (*). The issue is due to * in the request URL: https://stackoverflow.com/...
user avatar
249 votes
14 answers
230k views

How can I find out the current route in Rails?

I need to know the current route in a filter in Rails. How can I find out what it is? I'm doing REST resources, and see no named routes.
luca's user avatar
  • 12.6k
249 votes
13 answers
229k views

How to get current route in Symfony 2?

How do I get the current route in Symfony 2? For example, routing.yml: somePage: pattern: /page/ defaults: { _controller: "AcmeBundle:Test:index" } How can I get this somePage value?
IlyaDoroshin's user avatar
  • 4,669
245 votes
8 answers
363k views

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: ...
Robert Christian's user avatar
244 votes
10 answers
81k views

Is it possible to make an ASP.NET MVC route based on a subdomain?

Is it possible to have an ASP.NET MVC route that uses subdomain information to determine its route? For example: user1.domain.example goes to one place user2.domain.example goes to another? Or, can ...
Dan Esparza's user avatar
  • 28.3k
230 votes
11 answers
402k views

How to open a link in new tab using angular?

I have an angular 5 component that needs to open a link in new tab, I tried the following: <a href="www.example.com" target="_blank">page link</a> when I open the link, the application ...
AlejoDev's user avatar
  • 4,632
230 votes
8 answers
214k views

Angular 2 router no base href set

I am getting an error and can't find why. Here is the error: EXCEPTION: Error during instantiation of LocationStrategy! (RouterOutlet -> Router -> Location -> LocationStrategy). angular2....
Jason Spick's user avatar
  • 6,088
216 votes
3 answers
173k views

Failed to instantiate module [$injector:unpr] Unknown provider: $routeProvider

I received this error upon upgrading from AngularJS 1.0.7 to 1.2.0rc1.
Scotty.NET's user avatar
  • 12.5k
207 votes
21 answers
636k views

Next.js Redirect from / to another page

I'm new in Next.js and I'm wondering how to redirect from start page ( / ) to /hello-nextjs for example. Once user loads a page and after that determine if path === / redirect to /hello-nextjs In ...
Arthur's user avatar
  • 3,436
198 votes
14 answers
271k views

Change route params without reloading in Angular 2

I'm making a real estate website using Angular 2, Google Maps, etc. and when a user changes the center of the map I perform a search to the API indicating the current position of the map as well as ...
Marcos Basualdo's user avatar
195 votes
18 answers
265k views

Passive Link in Angular 2 - <a href=""> equivalent

In Angular 1.x I can do the following to create a link which does basically nothing: <a href="">My Link</a> But the same tag navigates to the app base in Angular 2. What is the ...
s.alem's user avatar
  • 13k

15 30 50 per page
1
2 3 4 5
2233