سؤال

Using for example

var myCode = ($location.search()).code

and pointing browser to http://localhost/#/?code=123 will set myCode = 123 but with browser pointing to http://localhost/?code=123#/ will leave myCode empty.

I think this is different behaviour than described in the angular docs. Angular docs describe this: angularlocation

Am I missing something here or is there no good way of reading the query parameters that are before the fragment?

هل كانت مفيدة؟

المحلول

You might need to expliclty set HTML5 mode. You can do it when configuring the $locationProvider

$locationProvider.html5Mode(true)

See http://docs.angularjs.org/guide/dev_guide.services.$location for more details

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top