iron router - trying to use params on main route (/) of my meteor app -


I am trying to use the parameters on my main path but in fact the parameters are not set and they are used in the path Is done:

  router.map (function function clausotorometer () {this.route ('home', {path: '/: _ redirect?', Action: function functional client rotormap action () {Console.log (this.path, this.params);}})});   

Now what do I get if I try manual redirection here:

  router.Go ('home'); // it's / = & gt; Redirects right on the router. Go ('home', {_redirect: test}); // it.path = test, and this is empty.   

How can I use _REDirect as a parameter and no way?

thanks

router.Go your first argument (Copy) as a path. So if you are going to the program as the same result as the user / redirectMe anywhere , then you can use it only:

  router.Go ( '/ Redirects are anywhere');   

and this.params._redirect should be 'redirection anywhere anywhere' .

Note that @pandua means if you have other routes then this chaos can be due to the route defined as /: anything , because the other Routes can never start If the above moves do not, then try to comment on all your other routes so that it can change anything.

Comments

Popular posts from this blog

Java - Error: no suitable method found for add(int, java.lang.String) -

java - JPA TypedQuery: Parameter value element did not match expected type -

c++ - static template member variable has internal linkage but is not defined -