angular ui router - Angularjs 1.x -- UIRouter Path /XYZ vs /#!/XYZ -


i trying create path variable @ top level. eg: website.com/xyz123 xyz123 account code. how can in angular app?

my config below:

    $urlrouterprovider.otherwise('/');     .state ('/', {           url: '/',           templateurl: 'views/landing.html',           controller: 'landingctrl',           authenticate: false       }).state ('signin', {           url: '/{accountcode:[0-9a-z]{6}}',           templateurl: 'views/student/signin.html',           controller: 'studentsigninctrl',           authenticate: false       }) 

website.com/#!/xyz123 -- works.. can make website.com/xyz123 go angularjs spa?

thanks

in config block in main module, use $locationprovider turn off html5 mode , not display hash in route:

// removes fragment identifier ('#') urls $locationprovider.html5mode(true); 

note there caveats of doing this, need make sure include <base> tag in main (index) html file:

<head>     <base href="/"/> </head> 

for documented references, see $locationprovider.


Comments

Popular posts from this blog

php - Permission denied. Laravel linux server -

google bigquery - Delta between query execution time and Java query call to finish -

python - Pandas two dataframes multiplication? -