Angularjs routeProvider adds *?* or %3F to URL with optional parameter -


I am trying to understand why ? I have an optional parameter in the or % 3F URL

  $ route provider. When ('/: Locale? /', {TemplateUrl: '/views/index.html', Controller: 'myController', Title: 'Title'}). Otherwise ({redirectTo: '/'}); // html5mode $ locationProvider.html5Mode (true); $ LocationProvider.hashPrefix ('!');     

will end with the URL

I'm not sure what other information is that to help me get the right answer Should provide me, but please tell me.

$ route provider and routing Does not work with me, and I think the angle thinks that you are trying to experiment them, but rather define the alternative parameter

I do not think you have to give your alternative parameters your way Are correctly defined in I belive that you need to do it this way:

  $ routePro Vider When ('/: Locale?', {TemplateUrl: '/views/index.html', Controller: 'myController', Title: 'Title'}). Otherwise ({redirectTo: '/'});   

Note that I removed / after your route and now I think the angular should be able to identify this route with optional parameters

Comments

Popular posts from this blog

java - ImportError: No module named py4j.java_gateway -

python - Receiving "KeyError" after decoding json result from url -

.net - Creating a new Queue Manager and Queue in Websphere MQ (using C#) -