简体   繁体   中英

breaking change in angular 1.5.9 $location.hashPrefix

It looks like the default $location.hashPrefix was "" (empty string) until 1.5.8 , however, it was changed to "!" in 1.5.9 . Unfortunately, my code has a lot of places like <a ng-ref="/Customer#/{{customerId}}> that is now breaking. Is there a global way to handle this? Or the only way is to go through the whole codebase in preparation for 1.5.9? FWIW, I am curious what was the rationale for this - can't find a discussion anywhere...

You are correct that the default hasPrefix changed from "" to "!" .

If you set your hasPrefix to an empty string like $locationProvider.hashPrefix(''); routes like /Customer/#/{{customerId}} that worked in 1.5.8 would work start resolving again in 1.5.9, from the testing that I have done, though they it will still render like /Customer/#!/1

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM